diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index afe529399a8f..f94e9bf20163 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1639,6 +1639,9 @@ # PRLabel: %Mgmt sdk/storagediscovery/arm-storagediscovery/ @qiaozha @MaryGao +# PRLabel: %Mgmt +sdk/azurestackhcivm/arm-azurestackhcivm/ @qiaozha @MaryGao + ########### # Config ########### diff --git a/eng/ignore-links.txt b/eng/ignore-links.txt index 95ede56d81cf..d7ca79a4c97b 100644 --- a/eng/ignore-links.txt +++ b/eng/ignore-links.txt @@ -46,3 +46,4 @@ https://learn.microsoft.com/javascript/api/@azure/arm-cloudhealth?view=azure-nod https://learn.microsoft.com/javascript/api/@azure/arm-resourcesbicep?view=azure-node-preview https://learn.microsoft.com/javascript/api/@azure/arm-resourcesdeployments?view=azure-node-preview https://learn.microsoft.com/javascript/api/@azure/arm-storagediscovery?view=azure-node-preview +https://learn.microsoft.com/javascript/api/@azure/arm-azurestackhcivm?view=azure-node-preview diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 7fc765e253de..5b008581ac69 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -2482,6 +2482,76 @@ importers: specifier: ^3.0.9 version: 3.2.4(@types/debug@4.1.12)(@types/node@20.19.9)(@vitest/browser@3.2.4)(jsdom@16.7.0)(msw@2.7.3(@types/node@20.19.9)(typescript@5.8.3))(terser@5.39.0)(tsx@4.20.3)(yaml@2.8.1) + sdk/azurestackhcivm/arm-azurestackhcivm: + dependencies: + '@azure-rest/core-client': + specifier: ^2.3.1 + version: link:../../core/core-client-rest + '@azure/abort-controller': + specifier: ^2.1.2 + version: link:../../core/abort-controller + '@azure/core-auth': + specifier: ^1.9.0 + version: link:../../core/core-auth + '@azure/core-lro': + specifier: ^3.1.0 + version: link:../../core/core-lro + '@azure/core-rest-pipeline': + specifier: ^1.20.0 + version: link:../../core/core-rest-pipeline + '@azure/core-util': + specifier: ^1.12.0 + version: link:../../core/core-util + '@azure/logger': + specifier: ^1.2.0 + version: link:../../core/logger + tslib: + specifier: ^2.8.1 + version: 2.8.1 + devDependencies: + '@azure-tools/test-credential': + specifier: ^2.0.0 + version: link:../../test-utils/test-credential + '@azure-tools/test-recorder': + specifier: ^4.1.0 + version: link:../../test-utils/recorder + '@azure-tools/test-utils-vitest': + specifier: ^1.0.0 + version: link:../../test-utils/test-utils-vitest + '@azure/dev-tool': + specifier: ^1.0.0 + version: link:../../../common/tools/dev-tool + '@azure/eslint-plugin-azure-sdk': + specifier: ^3.0.0 + version: link:../../../common/tools/eslint-plugin-azure-sdk + '@azure/identity': + specifier: ^4.9.0 + version: link:../../identity/identity + '@types/node': + specifier: ^20.0.0 + version: 20.19.9 + '@vitest/browser': + specifier: ^3.0.9 + version: 3.2.4(msw@2.7.3(@types/node@20.19.9)(typescript@5.8.3))(playwright@1.54.2)(vite@7.1.1(@types/node@20.19.9)(terser@5.39.0)(tsx@4.20.3)(yaml@2.8.1))(vitest@3.2.4) + '@vitest/coverage-istanbul': + specifier: ^3.0.9 + version: 3.2.4(vitest@3.2.4) + dotenv: + specifier: ^16.0.0 + version: 16.6.1 + eslint: + specifier: ^9.9.0 + version: 9.32.0 + playwright: + specifier: ^1.52.0 + version: 1.54.2 + typescript: + specifier: ~5.8.2 + version: 5.8.3 + vitest: + specifier: ^3.0.9 + version: 3.2.4(@types/debug@4.1.12)(@types/node@20.19.9)(@vitest/browser@3.2.4)(jsdom@16.7.0)(msw@2.7.3(@types/node@20.19.9)(typescript@5.8.3))(terser@5.39.0)(tsx@4.20.3)(yaml@2.8.1) + sdk/baremetalinfrastructure/arm-baremetalinfrastructure: dependencies: '@azure/abort-controller': diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/CHANGELOG.md b/sdk/azurestackhcivm/arm-azurestackhcivm/CHANGELOG.md new file mode 100644 index 000000000000..51732bc1e031 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/CHANGELOG.md @@ -0,0 +1,7 @@ +# Release History + +## 1.0.0-beta.1 (2025-08-14) + +### Features Added + +Initial release of the @azure/arm-azurestackhcivm package diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/LICENSE b/sdk/azurestackhcivm/arm-azurestackhcivm/LICENSE new file mode 100644 index 000000000000..63447fd8bbbf --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/LICENSE @@ -0,0 +1,21 @@ +Copyright (c) Microsoft Corporation. + +MIT License + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/README.md b/sdk/azurestackhcivm/arm-azurestackhcivm/README.md new file mode 100644 index 000000000000..794fb435a994 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/README.md @@ -0,0 +1,115 @@ +# AzureStackHCIVMManagement client library for JavaScript + +This package contains an isomorphic SDK (runs both in Node.js and in browsers) for AzureStackHCIVMManagement client. + +Azure Stack HCI management service + +Key links: + +- [Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/azurestackhcivm/arm-azurestackhcivm) +- [Package (NPM)](https://www.npmjs.com/package/@azure/arm-azurestackhcivm) +- [API reference documentation](https://learn.microsoft.com/javascript/api/@azure/arm-azurestackhcivm?view=azure-node-preview) +- [Samples](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/azurestackhcivm/arm-azurestackhcivm/samples) + +## Getting started + +### Currently supported environments + +- [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule) +- Latest versions of Safari, Chrome, Edge and Firefox. + +See our [support policy](https://github.com/Azure/azure-sdk-for-js/blob/main/SUPPORT.md) for more details. + +### Prerequisites + +- An [Azure subscription][azure_sub]. + +### Install the `@azure/arm-azurestackhcivm` package + +Install the AzureStackHCIVMManagement client library for JavaScript with `npm`: + +```bash +npm install @azure/arm-azurestackhcivm +``` + +### Create and authenticate a `AzureStackHCIVMManagementClient` + +To create a client object to access the AzureStackHCIVMManagement API, you will need the `endpoint` of your AzureStackHCIVMManagement resource and a `credential`. The AzureStackHCIVMManagement client can use Azure Active Directory credentials to authenticate. +You can find the endpoint for your AzureStackHCIVMManagement resource in the [Azure Portal][azure_portal]. + +You can authenticate with Azure Active Directory using a credential from the [@azure/identity][azure_identity] library or [an existing AAD Token](https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-with-a-pre-fetched-access-token). + +To use the [DefaultAzureCredential][defaultazurecredential] provider shown below, or other credential providers provided with the Azure SDK, please install the `@azure/identity` package: + +```bash +npm install @azure/identity +``` + +You will also need to **register a new AAD application and grant access to AzureStackHCIVMManagement** by assigning the suitable role to your service principal (note: roles such as `"Owner"` will not grant the necessary permissions). + +For more information about how to create an Azure AD Application check out [this guide](https://learn.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal). + +Using Node.js and Node-like environments, you can use the `DefaultAzureCredential` class to authenticate the client. + +```ts snippet:ReadmeSampleCreateClient_Node +import { AzureStackHCIVMManagementClient } from "@azure/arm-azurestackhcivm"; +import { DefaultAzureCredential } from "@azure/identity"; + +const subscriptionId = "00000000-0000-0000-0000-000000000000"; +const client = new AzureStackHCIVMManagementClient(new DefaultAzureCredential(), subscriptionId); +``` + +For browser environments, use the `InteractiveBrowserCredential` from the `@azure/identity` package to authenticate. + +```ts snippet:ReadmeSampleCreateClient_Browser +import { InteractiveBrowserCredential } from "@azure/identity"; +import { AzureStackHCIVMManagementClient } from "@azure/arm-azurestackhcivm"; + +const credential = new InteractiveBrowserCredential({ + tenantId: "", + clientId: "", +}); +const subscriptionId = "00000000-0000-0000-0000-000000000000"; +const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); +``` + + +### JavaScript Bundle +To use this client library in the browser, first you need to use a bundler. For details on how to do this, please refer to our [bundling documentation](https://aka.ms/AzureSDKBundling). + +## Key concepts + +### AzureStackHCIVMManagementClient + +`AzureStackHCIVMManagementClient` is the primary interface for developers using the AzureStackHCIVMManagement client library. Explore the methods on this client object to understand the different features of the AzureStackHCIVMManagement service that you can access. + +## Troubleshooting + +### Logging + +Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`: + +```ts snippet:SetLogLevel +import { setLogLevel } from "@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/azurestackhcivm/arm-azurestackhcivm/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. + +## Related projects + +- [Microsoft Azure SDK for JavaScript](https://github.com/Azure/azure-sdk-for-js) + +[azure_sub]: https://azure.microsoft.com/free/ +[azure_portal]: https://portal.azure.com +[azure_identity]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity +[defaultazurecredential]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity#defaultazurecredential diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/api-extractor.json b/sdk/azurestackhcivm/arm-azurestackhcivm/api-extractor.json new file mode 100644 index 000000000000..870d6d399477 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/api-extractor.json @@ -0,0 +1 @@ +{ "extends": "../../../api-extractor-base.json" } diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/assets.json b/sdk/azurestackhcivm/arm-azurestackhcivm/assets.json new file mode 100644 index 000000000000..b300400d9cf0 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/assets.json @@ -0,0 +1,6 @@ +{ + "AssetsRepo": "Azure/azure-sdk-assets", + "AssetsRepoPrefixPath": "js", + "TagPrefix": "js/azurestackhcivm/arm-azurestackhcivm", + "Tag": "js/azurestackhcivm/arm-azurestackhcivm_a9770c3bcb" +} diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/eslint.config.mjs b/sdk/azurestackhcivm/arm-azurestackhcivm/eslint.config.mjs new file mode 100644 index 000000000000..6d2f8a5914c3 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/eslint.config.mjs @@ -0,0 +1,14 @@ +import azsdkEslint from "@azure/eslint-plugin-azure-sdk"; + +export default azsdkEslint.config([ + { + rules: { + "@azure/azure-sdk/ts-modules-only-named": "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-files-required": "off", + "@azure/azure-sdk/ts-package-json-main-is-cjs": "off", + "tsdoc/syntax": "warn", + }, + }, +]); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/metadata.json b/sdk/azurestackhcivm/arm-azurestackhcivm/metadata.json new file mode 100644 index 000000000000..f9e1db55a3b4 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/metadata.json @@ -0,0 +1,4 @@ +{ + "apiVersion": "2025-06-01-preview", + "emitterVersion": "0.43.0" +} diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/package.json b/sdk/azurestackhcivm/arm-azurestackhcivm/package.json new file mode 100644 index 000000000000..bff27d53a4a7 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/package.json @@ -0,0 +1,402 @@ +{ + "name": "@azure/arm-azurestackhcivm", + "version": "1.0.0-beta.1", + "description": "A generated SDK for AzureStackHCIVMManagementClient.", + "engines": { + "node": ">=20.0.0" + }, + "sideEffects": false, + "autoPublish": false, + "tshy": { + "exports": { + "./package.json": "./package.json", + ".": "./src/index.ts", + "./api": "./src/api/index.ts", + "./api/guestAgents": "./src/api/guestAgents/index.ts", + "./api/attestationStatuses": "./src/api/attestationStatuses/index.ts", + "./api/hybridIdentityMetadata": "./src/api/hybridIdentityMetadata/index.ts", + "./api/virtualMachineInstances": "./src/api/virtualMachineInstances/index.ts", + "./api/virtualHardDisks": "./src/api/virtualHardDisks/index.ts", + "./api/storageContainers": "./src/api/storageContainers/index.ts", + "./api/securityRules": "./src/api/securityRules/index.ts", + "./api/networkSecurityGroups": "./src/api/networkSecurityGroups/index.ts", + "./api/networkInterfaces": "./src/api/networkInterfaces/index.ts", + "./api/marketplaceGalleryImages": "./src/api/marketplaceGalleryImages/index.ts", + "./api/logicalNetworks": "./src/api/logicalNetworks/index.ts", + "./api/galleryImages": "./src/api/galleryImages/index.ts", + "./models": "./src/models/index.ts" + }, + "dialects": [ + "esm", + "commonjs" + ], + "esmDialects": [ + "browser", + "react-native" + ], + "selfLink": false, + "project": "./tsconfig.src.json" + }, + "type": "module", + "browser": "./dist/browser/index.js", + "react-native": "./dist/react-native/index.js", + "keywords": [ + "node", + "azure", + "cloud", + "typescript", + "browser", + "isomorphic" + ], + "author": "Microsoft Corporation", + "license": "MIT", + "files": [ + "dist/", + "!dist/**/*.d.*ts.map", + "README.md", + "LICENSE" + ], + "sdk-type": "mgmt", + "repository": "github:Azure/azure-sdk-for-js", + "bugs": { + "url": "https://github.com/Azure/azure-sdk-for-js/issues" + }, + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/azurestackhcivm/arm-azurestackhcivm/README.md", + "prettier": "@azure/eslint-plugin-azure-sdk/prettier.json", + "//metadata": { + "constantPaths": [ + { + "path": "src/api/azureStackHcivmManagementContext.ts", + "prefix": "userAgentInfo" + } + ] + }, + "dependencies": { + "@azure/core-util": "^1.12.0", + "@azure-rest/core-client": "^2.3.1", + "@azure/abort-controller": "^2.1.2", + "@azure/core-auth": "^1.9.0", + "@azure/core-lro": "^3.1.0", + "@azure/core-rest-pipeline": "^1.20.0", + "@azure/logger": "^1.2.0", + "tslib": "^2.8.1" + }, + "devDependencies": { + "@azure-tools/test-credential": "^2.0.0", + "@azure-tools/test-recorder": "^4.1.0", + "@azure-tools/test-utils-vitest": "^1.0.0", + "@azure/dev-tool": "^1.0.0", + "@azure/eslint-plugin-azure-sdk": "^3.0.0", + "@azure/identity": "^4.9.0", + "@types/node": "^20.0.0", + "eslint": "^9.9.0", + "@vitest/browser": "^3.0.9", + "@vitest/coverage-istanbul": "^3.0.9", + "dotenv": "^16.0.0", + "playwright": "^1.52.0", + "typescript": "~5.8.2", + "vitest": "^3.0.9" + }, + "scripts": { + "clean": "dev-tool run vendored rimraf --glob dist dist-browser dist-esm test-dist temp types *.tgz *.log", + "extract-api": "dev-tool run vendored rimraf review && dev-tool run extract-api", + "pack": "npm pack 2>&1", + "lint": "echo skipped", + "lint:fix": "echo skipped", + "build:samples": "tsc -p tsconfig.samples.json && dev-tool samples publish -f", + "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\"", + "execute:samples": "dev-tool samples run samples-dev", + "format": "dev-tool run vendored prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.{ts,cts,mts}\" \"test/**/*.{ts,cts,mts}\" \"*.{js,cjs,mjs,json}\" \"samples-dev/*.ts\"", + "generate:client": "echo skipped", + "test:browser": "dev-tool run build-test && dev-tool run test:vitest --browser", + "build": "npm run clean && dev-tool run build-package && dev-tool run extract-api", + "test:node": "dev-tool run test:vitest", + "test:node:esm": "dev-tool run test:vitest --esm", + "test": "npm run test:node && npm run test:browser", + "update-snippets": "dev-tool run update-snippets" + }, + "//sampleConfiguration": { + "productName": "@azure/arm-azurestackhcivm", + "productSlugs": [ + "azure" + ], + "disableDocsMs": true, + "apiRefLink": "https://learn.microsoft.com/javascript/api/@azure/arm-azurestackhcivm?view=azure-node-preview" + }, + "exports": { + "./package.json": "./package.json", + ".": { + "browser": { + "types": "./dist/browser/index.d.ts", + "default": "./dist/browser/index.js" + }, + "react-native": { + "types": "./dist/react-native/index.d.ts", + "default": "./dist/react-native/index.js" + }, + "import": { + "types": "./dist/esm/index.d.ts", + "default": "./dist/esm/index.js" + }, + "require": { + "types": "./dist/commonjs/index.d.ts", + "default": "./dist/commonjs/index.js" + } + }, + "./api": { + "browser": { + "types": "./dist/browser/api/index.d.ts", + "default": "./dist/browser/api/index.js" + }, + "react-native": { + "types": "./dist/react-native/api/index.d.ts", + "default": "./dist/react-native/api/index.js" + }, + "import": { + "types": "./dist/esm/api/index.d.ts", + "default": "./dist/esm/api/index.js" + }, + "require": { + "types": "./dist/commonjs/api/index.d.ts", + "default": "./dist/commonjs/api/index.js" + } + }, + "./api/guestAgents": { + "browser": { + "types": "./dist/browser/api/guestAgents/index.d.ts", + "default": "./dist/browser/api/guestAgents/index.js" + }, + "react-native": { + "types": "./dist/react-native/api/guestAgents/index.d.ts", + "default": "./dist/react-native/api/guestAgents/index.js" + }, + "import": { + "types": "./dist/esm/api/guestAgents/index.d.ts", + "default": "./dist/esm/api/guestAgents/index.js" + }, + "require": { + "types": "./dist/commonjs/api/guestAgents/index.d.ts", + "default": "./dist/commonjs/api/guestAgents/index.js" + } + }, + "./api/attestationStatuses": { + "browser": { + "types": "./dist/browser/api/attestationStatuses/index.d.ts", + "default": "./dist/browser/api/attestationStatuses/index.js" + }, + "react-native": { + "types": "./dist/react-native/api/attestationStatuses/index.d.ts", + "default": "./dist/react-native/api/attestationStatuses/index.js" + }, + "import": { + "types": "./dist/esm/api/attestationStatuses/index.d.ts", + "default": "./dist/esm/api/attestationStatuses/index.js" + }, + "require": { + "types": "./dist/commonjs/api/attestationStatuses/index.d.ts", + "default": "./dist/commonjs/api/attestationStatuses/index.js" + } + }, + "./api/hybridIdentityMetadata": { + "browser": { + "types": "./dist/browser/api/hybridIdentityMetadata/index.d.ts", + "default": "./dist/browser/api/hybridIdentityMetadata/index.js" + }, + "react-native": { + "types": "./dist/react-native/api/hybridIdentityMetadata/index.d.ts", + "default": "./dist/react-native/api/hybridIdentityMetadata/index.js" + }, + "import": { + "types": "./dist/esm/api/hybridIdentityMetadata/index.d.ts", + "default": "./dist/esm/api/hybridIdentityMetadata/index.js" + }, + "require": { + "types": "./dist/commonjs/api/hybridIdentityMetadata/index.d.ts", + "default": "./dist/commonjs/api/hybridIdentityMetadata/index.js" + } + }, + "./api/virtualMachineInstances": { + "browser": { + "types": "./dist/browser/api/virtualMachineInstances/index.d.ts", + "default": "./dist/browser/api/virtualMachineInstances/index.js" + }, + "react-native": { + "types": "./dist/react-native/api/virtualMachineInstances/index.d.ts", + "default": "./dist/react-native/api/virtualMachineInstances/index.js" + }, + "import": { + "types": "./dist/esm/api/virtualMachineInstances/index.d.ts", + "default": "./dist/esm/api/virtualMachineInstances/index.js" + }, + "require": { + "types": "./dist/commonjs/api/virtualMachineInstances/index.d.ts", + "default": "./dist/commonjs/api/virtualMachineInstances/index.js" + } + }, + "./api/virtualHardDisks": { + "browser": { + "types": "./dist/browser/api/virtualHardDisks/index.d.ts", + "default": "./dist/browser/api/virtualHardDisks/index.js" + }, + "react-native": { + "types": "./dist/react-native/api/virtualHardDisks/index.d.ts", + "default": "./dist/react-native/api/virtualHardDisks/index.js" + }, + "import": { + "types": "./dist/esm/api/virtualHardDisks/index.d.ts", + "default": "./dist/esm/api/virtualHardDisks/index.js" + }, + "require": { + "types": "./dist/commonjs/api/virtualHardDisks/index.d.ts", + "default": "./dist/commonjs/api/virtualHardDisks/index.js" + } + }, + "./api/storageContainers": { + "browser": { + "types": "./dist/browser/api/storageContainers/index.d.ts", + "default": "./dist/browser/api/storageContainers/index.js" + }, + "react-native": { + "types": "./dist/react-native/api/storageContainers/index.d.ts", + "default": "./dist/react-native/api/storageContainers/index.js" + }, + "import": { + "types": "./dist/esm/api/storageContainers/index.d.ts", + "default": "./dist/esm/api/storageContainers/index.js" + }, + "require": { + "types": "./dist/commonjs/api/storageContainers/index.d.ts", + "default": "./dist/commonjs/api/storageContainers/index.js" + } + }, + "./api/securityRules": { + "browser": { + "types": "./dist/browser/api/securityRules/index.d.ts", + "default": "./dist/browser/api/securityRules/index.js" + }, + "react-native": { + "types": "./dist/react-native/api/securityRules/index.d.ts", + "default": "./dist/react-native/api/securityRules/index.js" + }, + "import": { + "types": "./dist/esm/api/securityRules/index.d.ts", + "default": "./dist/esm/api/securityRules/index.js" + }, + "require": { + "types": "./dist/commonjs/api/securityRules/index.d.ts", + "default": "./dist/commonjs/api/securityRules/index.js" + } + }, + "./api/networkSecurityGroups": { + "browser": { + "types": "./dist/browser/api/networkSecurityGroups/index.d.ts", + "default": "./dist/browser/api/networkSecurityGroups/index.js" + }, + "react-native": { + "types": "./dist/react-native/api/networkSecurityGroups/index.d.ts", + "default": "./dist/react-native/api/networkSecurityGroups/index.js" + }, + "import": { + "types": "./dist/esm/api/networkSecurityGroups/index.d.ts", + "default": "./dist/esm/api/networkSecurityGroups/index.js" + }, + "require": { + "types": "./dist/commonjs/api/networkSecurityGroups/index.d.ts", + "default": "./dist/commonjs/api/networkSecurityGroups/index.js" + } + }, + "./api/networkInterfaces": { + "browser": { + "types": "./dist/browser/api/networkInterfaces/index.d.ts", + "default": "./dist/browser/api/networkInterfaces/index.js" + }, + "react-native": { + "types": "./dist/react-native/api/networkInterfaces/index.d.ts", + "default": "./dist/react-native/api/networkInterfaces/index.js" + }, + "import": { + "types": "./dist/esm/api/networkInterfaces/index.d.ts", + "default": "./dist/esm/api/networkInterfaces/index.js" + }, + "require": { + "types": "./dist/commonjs/api/networkInterfaces/index.d.ts", + "default": "./dist/commonjs/api/networkInterfaces/index.js" + } + }, + "./api/marketplaceGalleryImages": { + "browser": { + "types": "./dist/browser/api/marketplaceGalleryImages/index.d.ts", + "default": "./dist/browser/api/marketplaceGalleryImages/index.js" + }, + "react-native": { + "types": "./dist/react-native/api/marketplaceGalleryImages/index.d.ts", + "default": "./dist/react-native/api/marketplaceGalleryImages/index.js" + }, + "import": { + "types": "./dist/esm/api/marketplaceGalleryImages/index.d.ts", + "default": "./dist/esm/api/marketplaceGalleryImages/index.js" + }, + "require": { + "types": "./dist/commonjs/api/marketplaceGalleryImages/index.d.ts", + "default": "./dist/commonjs/api/marketplaceGalleryImages/index.js" + } + }, + "./api/logicalNetworks": { + "browser": { + "types": "./dist/browser/api/logicalNetworks/index.d.ts", + "default": "./dist/browser/api/logicalNetworks/index.js" + }, + "react-native": { + "types": "./dist/react-native/api/logicalNetworks/index.d.ts", + "default": "./dist/react-native/api/logicalNetworks/index.js" + }, + "import": { + "types": "./dist/esm/api/logicalNetworks/index.d.ts", + "default": "./dist/esm/api/logicalNetworks/index.js" + }, + "require": { + "types": "./dist/commonjs/api/logicalNetworks/index.d.ts", + "default": "./dist/commonjs/api/logicalNetworks/index.js" + } + }, + "./api/galleryImages": { + "browser": { + "types": "./dist/browser/api/galleryImages/index.d.ts", + "default": "./dist/browser/api/galleryImages/index.js" + }, + "react-native": { + "types": "./dist/react-native/api/galleryImages/index.d.ts", + "default": "./dist/react-native/api/galleryImages/index.js" + }, + "import": { + "types": "./dist/esm/api/galleryImages/index.d.ts", + "default": "./dist/esm/api/galleryImages/index.js" + }, + "require": { + "types": "./dist/commonjs/api/galleryImages/index.d.ts", + "default": "./dist/commonjs/api/galleryImages/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" +} diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/review/arm-azurestackhcivm-api-attestationStatuses-node.api.md b/sdk/azurestackhcivm/arm-azurestackhcivm/review/arm-azurestackhcivm-api-attestationStatuses-node.api.md new file mode 100644 index 000000000000..7f6f6c87529b --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/review/arm-azurestackhcivm-api-attestationStatuses-node.api.md @@ -0,0 +1,19 @@ +## API Report File for "@azure/arm-azurestackhcivm" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +import { Client } from '@azure-rest/core-client'; +import { OperationOptions } from '@azure-rest/core-client'; + +// @public +export interface AttestationStatusesGetOptionalParams extends OperationOptions { +} + +// @public +export function get(context: AzureStackHCIVMManagementContext, resourceUri: string, options?: AttestationStatusesGetOptionalParams): Promise; + +// (No @packageDocumentation comment for this package) + +``` diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/review/arm-azurestackhcivm-api-galleryImages-node.api.md b/sdk/azurestackhcivm/arm-azurestackhcivm/review/arm-azurestackhcivm-api-galleryImages-node.api.md new file mode 100644 index 000000000000..de213106dfc6 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/review/arm-azurestackhcivm-api-galleryImages-node.api.md @@ -0,0 +1,59 @@ +## API Report File for "@azure/arm-azurestackhcivm" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +import { Client } from '@azure-rest/core-client'; +import { OperationOptions } from '@azure-rest/core-client'; +import { OperationState } from '@azure/core-lro'; +import { PollerLike } from '@azure/core-lro'; + +// @public +export function $delete(context: AzureStackHCIVMManagementContext, resourceGroupName: string, galleryImageName: string, options?: GalleryImagesDeleteOptionalParams): PollerLike, void>; + +// @public +export function createOrUpdate(context: AzureStackHCIVMManagementContext, resourceGroupName: string, galleryImageName: string, resource: GalleryImage, options?: GalleryImagesCreateOrUpdateOptionalParams): PollerLike, GalleryImage>; + +// @public +export interface GalleryImagesCreateOrUpdateOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface GalleryImagesDeleteOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface GalleryImagesGetOptionalParams extends OperationOptions { +} + +// @public +export interface GalleryImagesListAllOptionalParams extends OperationOptions { +} + +// @public +export interface GalleryImagesListByResourceGroupOptionalParams extends OperationOptions { +} + +// @public +export interface GalleryImagesUpdateOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export function get(context: AzureStackHCIVMManagementContext, resourceGroupName: string, galleryImageName: string, options?: GalleryImagesGetOptionalParams): Promise; + +// @public +export function listAll(context: AzureStackHCIVMManagementContext, options?: GalleryImagesListAllOptionalParams): PagedAsyncIterableIterator; + +// @public +export function listByResourceGroup(context: AzureStackHCIVMManagementContext, resourceGroupName: string, options?: GalleryImagesListByResourceGroupOptionalParams): PagedAsyncIterableIterator; + +// @public +export function update(context: AzureStackHCIVMManagementContext, resourceGroupName: string, galleryImageName: string, properties: GalleryImageTagsUpdate, options?: GalleryImagesUpdateOptionalParams): PollerLike, GalleryImage>; + +// (No @packageDocumentation comment for this package) + +``` diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/review/arm-azurestackhcivm-api-guestAgents-node.api.md b/sdk/azurestackhcivm/arm-azurestackhcivm/review/arm-azurestackhcivm-api-guestAgents-node.api.md new file mode 100644 index 000000000000..c9914a18881f --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/review/arm-azurestackhcivm-api-guestAgents-node.api.md @@ -0,0 +1,44 @@ +## API Report File for "@azure/arm-azurestackhcivm" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +import { Client } from '@azure-rest/core-client'; +import { OperationOptions } from '@azure-rest/core-client'; +import { OperationState } from '@azure/core-lro'; +import { PollerLike } from '@azure/core-lro'; + +// @public +export function $delete(context: AzureStackHCIVMManagementContext, resourceUri: string, options?: GuestAgentsDeleteOptionalParams): PollerLike, void>; + +// @public +export function create(context: AzureStackHCIVMManagementContext, resourceUri: string, resource: GuestAgent, options?: GuestAgentsCreateOptionalParams): PollerLike, GuestAgent>; + +// @public +export function get(context: AzureStackHCIVMManagementContext, resourceUri: string, options?: GuestAgentsGetOptionalParams): Promise; + +// @public +export interface GuestAgentsCreateOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface GuestAgentsDeleteOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface GuestAgentsGetOptionalParams extends OperationOptions { +} + +// @public +export interface GuestAgentsListByVirtualMachineInstanceOptionalParams extends OperationOptions { +} + +// @public +export function listByVirtualMachineInstance(context: AzureStackHCIVMManagementContext, resourceUri: string, options?: GuestAgentsListByVirtualMachineInstanceOptionalParams): PagedAsyncIterableIterator; + +// (No @packageDocumentation comment for this package) + +``` diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/review/arm-azurestackhcivm-api-hybridIdentityMetadata-node.api.md b/sdk/azurestackhcivm/arm-azurestackhcivm/review/arm-azurestackhcivm-api-hybridIdentityMetadata-node.api.md new file mode 100644 index 000000000000..ddf9047a86ff --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/review/arm-azurestackhcivm-api-hybridIdentityMetadata-node.api.md @@ -0,0 +1,26 @@ +## API Report File for "@azure/arm-azurestackhcivm" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +import { Client } from '@azure-rest/core-client'; +import { OperationOptions } from '@azure-rest/core-client'; + +// @public +export function get(context: AzureStackHCIVMManagementContext, resourceUri: string, options?: HybridIdentityMetadataGetOptionalParams): Promise; + +// @public +export interface HybridIdentityMetadataGetOptionalParams extends OperationOptions { +} + +// @public +export interface HybridIdentityMetadataListByVirtualMachineInstanceOptionalParams extends OperationOptions { +} + +// @public +export function listByVirtualMachineInstance(context: AzureStackHCIVMManagementContext, resourceUri: string, options?: HybridIdentityMetadataListByVirtualMachineInstanceOptionalParams): PagedAsyncIterableIterator; + +// (No @packageDocumentation comment for this package) + +``` diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/review/arm-azurestackhcivm-api-logicalNetworks-node.api.md b/sdk/azurestackhcivm/arm-azurestackhcivm/review/arm-azurestackhcivm-api-logicalNetworks-node.api.md new file mode 100644 index 000000000000..7d4e9691cc26 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/review/arm-azurestackhcivm-api-logicalNetworks-node.api.md @@ -0,0 +1,59 @@ +## API Report File for "@azure/arm-azurestackhcivm" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +import { Client } from '@azure-rest/core-client'; +import { OperationOptions } from '@azure-rest/core-client'; +import { OperationState } from '@azure/core-lro'; +import { PollerLike } from '@azure/core-lro'; + +// @public +export function $delete(context: AzureStackHCIVMManagementContext, resourceGroupName: string, logicalNetworkName: string, options?: LogicalNetworksDeleteOptionalParams): PollerLike, void>; + +// @public +export function createOrUpdate(context: AzureStackHCIVMManagementContext, resourceGroupName: string, logicalNetworkName: string, resource: LogicalNetwork, options?: LogicalNetworksCreateOrUpdateOptionalParams): PollerLike, LogicalNetwork>; + +// @public +export function get(context: AzureStackHCIVMManagementContext, resourceGroupName: string, logicalNetworkName: string, options?: LogicalNetworksGetOptionalParams): Promise; + +// @public +export function listAll(context: AzureStackHCIVMManagementContext, options?: LogicalNetworksListAllOptionalParams): PagedAsyncIterableIterator; + +// @public +export function listByResourceGroup(context: AzureStackHCIVMManagementContext, resourceGroupName: string, options?: LogicalNetworksListByResourceGroupOptionalParams): PagedAsyncIterableIterator; + +// @public +export interface LogicalNetworksCreateOrUpdateOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface LogicalNetworksDeleteOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface LogicalNetworksGetOptionalParams extends OperationOptions { +} + +// @public +export interface LogicalNetworksListAllOptionalParams extends OperationOptions { +} + +// @public +export interface LogicalNetworksListByResourceGroupOptionalParams extends OperationOptions { +} + +// @public +export interface LogicalNetworksUpdateOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export function update(context: AzureStackHCIVMManagementContext, resourceGroupName: string, logicalNetworkName: string, properties: LogicalNetworksUpdateRequest, options?: LogicalNetworksUpdateOptionalParams): PollerLike, LogicalNetwork>; + +// (No @packageDocumentation comment for this package) + +``` diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/review/arm-azurestackhcivm-api-marketplaceGalleryImages-node.api.md b/sdk/azurestackhcivm/arm-azurestackhcivm/review/arm-azurestackhcivm-api-marketplaceGalleryImages-node.api.md new file mode 100644 index 000000000000..227161d83f97 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/review/arm-azurestackhcivm-api-marketplaceGalleryImages-node.api.md @@ -0,0 +1,59 @@ +## API Report File for "@azure/arm-azurestackhcivm" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +import { Client } from '@azure-rest/core-client'; +import { OperationOptions } from '@azure-rest/core-client'; +import { OperationState } from '@azure/core-lro'; +import { PollerLike } from '@azure/core-lro'; + +// @public +export function $delete(context: AzureStackHCIVMManagementContext, resourceGroupName: string, marketplaceGalleryImageName: string, options?: MarketplaceGalleryImagesDeleteOptionalParams): PollerLike, void>; + +// @public +export function createOrUpdate(context: AzureStackHCIVMManagementContext, resourceGroupName: string, marketplaceGalleryImageName: string, resource: MarketplaceGalleryImage, options?: MarketplaceGalleryImagesCreateOrUpdateOptionalParams): PollerLike, MarketplaceGalleryImage>; + +// @public +export function get(context: AzureStackHCIVMManagementContext, resourceGroupName: string, marketplaceGalleryImageName: string, options?: MarketplaceGalleryImagesGetOptionalParams): Promise; + +// @public +export function listAll(context: AzureStackHCIVMManagementContext, options?: MarketplaceGalleryImagesListAllOptionalParams): PagedAsyncIterableIterator; + +// @public +export function listByResourceGroup(context: AzureStackHCIVMManagementContext, resourceGroupName: string, options?: MarketplaceGalleryImagesListByResourceGroupOptionalParams): PagedAsyncIterableIterator; + +// @public +export interface MarketplaceGalleryImagesCreateOrUpdateOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface MarketplaceGalleryImagesDeleteOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface MarketplaceGalleryImagesGetOptionalParams extends OperationOptions { +} + +// @public +export interface MarketplaceGalleryImagesListAllOptionalParams extends OperationOptions { +} + +// @public +export interface MarketplaceGalleryImagesListByResourceGroupOptionalParams extends OperationOptions { +} + +// @public +export interface MarketplaceGalleryImagesUpdateOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export function update(context: AzureStackHCIVMManagementContext, resourceGroupName: string, marketplaceGalleryImageName: string, properties: MarketplaceGalleryImageTagsUpdate, options?: MarketplaceGalleryImagesUpdateOptionalParams): PollerLike, MarketplaceGalleryImage>; + +// (No @packageDocumentation comment for this package) + +``` diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/review/arm-azurestackhcivm-api-networkInterfaces-node.api.md b/sdk/azurestackhcivm/arm-azurestackhcivm/review/arm-azurestackhcivm-api-networkInterfaces-node.api.md new file mode 100644 index 000000000000..be5dcef83148 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/review/arm-azurestackhcivm-api-networkInterfaces-node.api.md @@ -0,0 +1,59 @@ +## API Report File for "@azure/arm-azurestackhcivm" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +import { Client } from '@azure-rest/core-client'; +import { OperationOptions } from '@azure-rest/core-client'; +import { OperationState } from '@azure/core-lro'; +import { PollerLike } from '@azure/core-lro'; + +// @public +export function $delete(context: AzureStackHCIVMManagementContext, resourceGroupName: string, networkInterfaceName: string, options?: NetworkInterfacesDeleteOptionalParams): PollerLike, void>; + +// @public +export function createOrUpdate(context: AzureStackHCIVMManagementContext, resourceGroupName: string, networkInterfaceName: string, resource: NetworkInterface, options?: NetworkInterfacesCreateOrUpdateOptionalParams): PollerLike, NetworkInterface>; + +// @public +export function get(context: AzureStackHCIVMManagementContext, resourceGroupName: string, networkInterfaceName: string, options?: NetworkInterfacesGetOptionalParams): Promise; + +// @public +export function listAll(context: AzureStackHCIVMManagementContext, options?: NetworkInterfacesListAllOptionalParams): PagedAsyncIterableIterator; + +// @public +export function listByResourceGroup(context: AzureStackHCIVMManagementContext, resourceGroupName: string, options?: NetworkInterfacesListByResourceGroupOptionalParams): PagedAsyncIterableIterator; + +// @public +export interface NetworkInterfacesCreateOrUpdateOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface NetworkInterfacesDeleteOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface NetworkInterfacesGetOptionalParams extends OperationOptions { +} + +// @public +export interface NetworkInterfacesListAllOptionalParams extends OperationOptions { +} + +// @public +export interface NetworkInterfacesListByResourceGroupOptionalParams extends OperationOptions { +} + +// @public +export interface NetworkInterfacesUpdateOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export function update(context: AzureStackHCIVMManagementContext, resourceGroupName: string, networkInterfaceName: string, properties: NetworkInterfacesUpdateRequest, options?: NetworkInterfacesUpdateOptionalParams): PollerLike, NetworkInterface>; + +// (No @packageDocumentation comment for this package) + +``` diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/review/arm-azurestackhcivm-api-networkSecurityGroups-node.api.md b/sdk/azurestackhcivm/arm-azurestackhcivm/review/arm-azurestackhcivm-api-networkSecurityGroups-node.api.md new file mode 100644 index 000000000000..3ab12682c1f7 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/review/arm-azurestackhcivm-api-networkSecurityGroups-node.api.md @@ -0,0 +1,59 @@ +## API Report File for "@azure/arm-azurestackhcivm" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +import { Client } from '@azure-rest/core-client'; +import { OperationOptions } from '@azure-rest/core-client'; +import { OperationState } from '@azure/core-lro'; +import { PollerLike } from '@azure/core-lro'; + +// @public +export function $delete(context: AzureStackHCIVMManagementContext, resourceGroupName: string, networkSecurityGroupName: string, options?: NetworkSecurityGroupsDeleteOptionalParams): PollerLike, void>; + +// @public +export function createOrUpdate(context: AzureStackHCIVMManagementContext, resourceGroupName: string, networkSecurityGroupName: string, resource: NetworkSecurityGroup, options?: NetworkSecurityGroupsCreateOrUpdateOptionalParams): PollerLike, NetworkSecurityGroup>; + +// @public +export function get(context: AzureStackHCIVMManagementContext, resourceGroupName: string, networkSecurityGroupName: string, options?: NetworkSecurityGroupsGetOptionalParams): Promise; + +// @public +export function listAll(context: AzureStackHCIVMManagementContext, options?: NetworkSecurityGroupsListAllOptionalParams): PagedAsyncIterableIterator; + +// @public +export function listByResourceGroup(context: AzureStackHCIVMManagementContext, resourceGroupName: string, options?: NetworkSecurityGroupsListByResourceGroupOptionalParams): PagedAsyncIterableIterator; + +// @public +export interface NetworkSecurityGroupsCreateOrUpdateOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface NetworkSecurityGroupsDeleteOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface NetworkSecurityGroupsGetOptionalParams extends OperationOptions { +} + +// @public +export interface NetworkSecurityGroupsListAllOptionalParams extends OperationOptions { +} + +// @public +export interface NetworkSecurityGroupsListByResourceGroupOptionalParams extends OperationOptions { +} + +// @public +export interface NetworkSecurityGroupsUpdateTagsOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export function updateTags(context: AzureStackHCIVMManagementContext, resourceGroupName: string, networkSecurityGroupName: string, properties: NetworkSecurityGroupTagsUpdate, options?: NetworkSecurityGroupsUpdateTagsOptionalParams): PollerLike, NetworkSecurityGroup>; + +// (No @packageDocumentation comment for this package) + +``` diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/review/arm-azurestackhcivm-api-node.api.md b/sdk/azurestackhcivm/arm-azurestackhcivm/review/arm-azurestackhcivm-api-node.api.md new file mode 100644 index 000000000000..c01503314319 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/review/arm-azurestackhcivm-api-node.api.md @@ -0,0 +1,28 @@ +## API Report File for "@azure/arm-azurestackhcivm" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +import { Client } from '@azure-rest/core-client'; +import { ClientOptions } from '@azure-rest/core-client'; +import { TokenCredential } from '@azure/core-auth'; + +// @public +export interface AzureStackHCIVMManagementClientOptionalParams extends ClientOptions { + apiVersion?: string; + cloudSetting?: AzureSupportedClouds; +} + +// @public +export interface AzureStackHCIVMManagementContext extends Client { + apiVersion: string; + subscriptionId: string; +} + +// @public +export function createAzureStackHCIVMManagement(credential: TokenCredential, subscriptionId: string, options?: AzureStackHCIVMManagementClientOptionalParams): AzureStackHCIVMManagementContext; + +// (No @packageDocumentation comment for this package) + +``` diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/review/arm-azurestackhcivm-api-securityRules-node.api.md b/sdk/azurestackhcivm/arm-azurestackhcivm/review/arm-azurestackhcivm-api-securityRules-node.api.md new file mode 100644 index 000000000000..47d05c26896c --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/review/arm-azurestackhcivm-api-securityRules-node.api.md @@ -0,0 +1,44 @@ +## API Report File for "@azure/arm-azurestackhcivm" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +import { Client } from '@azure-rest/core-client'; +import { OperationOptions } from '@azure-rest/core-client'; +import { OperationState } from '@azure/core-lro'; +import { PollerLike } from '@azure/core-lro'; + +// @public +export function $delete(context: AzureStackHCIVMManagementContext, resourceGroupName: string, networkSecurityGroupName: string, securityRuleName: string, options?: SecurityRulesDeleteOptionalParams): PollerLike, void>; + +// @public +export function createOrUpdate(context: AzureStackHCIVMManagementContext, resourceGroupName: string, networkSecurityGroupName: string, securityRuleName: string, resource: SecurityRule, options?: SecurityRulesCreateOrUpdateOptionalParams): PollerLike, SecurityRule>; + +// @public +export function get(context: AzureStackHCIVMManagementContext, resourceGroupName: string, networkSecurityGroupName: string, securityRuleName: string, options?: SecurityRulesGetOptionalParams): Promise; + +// @public +export function listByNetworkSecurityGroup(context: AzureStackHCIVMManagementContext, resourceGroupName: string, networkSecurityGroupName: string, options?: SecurityRulesListByNetworkSecurityGroupOptionalParams): PagedAsyncIterableIterator; + +// @public +export interface SecurityRulesCreateOrUpdateOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface SecurityRulesDeleteOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface SecurityRulesGetOptionalParams extends OperationOptions { +} + +// @public +export interface SecurityRulesListByNetworkSecurityGroupOptionalParams extends OperationOptions { +} + +// (No @packageDocumentation comment for this package) + +``` diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/review/arm-azurestackhcivm-api-storageContainers-node.api.md b/sdk/azurestackhcivm/arm-azurestackhcivm/review/arm-azurestackhcivm-api-storageContainers-node.api.md new file mode 100644 index 000000000000..0882884ab873 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/review/arm-azurestackhcivm-api-storageContainers-node.api.md @@ -0,0 +1,59 @@ +## API Report File for "@azure/arm-azurestackhcivm" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +import { Client } from '@azure-rest/core-client'; +import { OperationOptions } from '@azure-rest/core-client'; +import { OperationState } from '@azure/core-lro'; +import { PollerLike } from '@azure/core-lro'; + +// @public +export function $delete(context: AzureStackHCIVMManagementContext, resourceGroupName: string, storageContainerName: string, options?: StorageContainersDeleteOptionalParams): PollerLike, void>; + +// @public +export function createOrUpdate(context: AzureStackHCIVMManagementContext, resourceGroupName: string, storageContainerName: string, resource: StorageContainer, options?: StorageContainersCreateOrUpdateOptionalParams): PollerLike, StorageContainer>; + +// @public +export function get(context: AzureStackHCIVMManagementContext, resourceGroupName: string, storageContainerName: string, options?: StorageContainersGetOptionalParams): Promise; + +// @public +export function listAll(context: AzureStackHCIVMManagementContext, options?: StorageContainersListAllOptionalParams): PagedAsyncIterableIterator; + +// @public +export function listByResourceGroup(context: AzureStackHCIVMManagementContext, resourceGroupName: string, options?: StorageContainersListByResourceGroupOptionalParams): PagedAsyncIterableIterator; + +// @public +export interface StorageContainersCreateOrUpdateOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface StorageContainersDeleteOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface StorageContainersGetOptionalParams extends OperationOptions { +} + +// @public +export interface StorageContainersListAllOptionalParams extends OperationOptions { +} + +// @public +export interface StorageContainersListByResourceGroupOptionalParams extends OperationOptions { +} + +// @public +export interface StorageContainersUpdateOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export function update(context: AzureStackHCIVMManagementContext, resourceGroupName: string, storageContainerName: string, properties: StorageContainerTagsUpdate, options?: StorageContainersUpdateOptionalParams): PollerLike, StorageContainer>; + +// (No @packageDocumentation comment for this package) + +``` diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/review/arm-azurestackhcivm-api-virtualHardDisks-node.api.md b/sdk/azurestackhcivm/arm-azurestackhcivm/review/arm-azurestackhcivm-api-virtualHardDisks-node.api.md new file mode 100644 index 000000000000..1e151a98a1e8 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/review/arm-azurestackhcivm-api-virtualHardDisks-node.api.md @@ -0,0 +1,67 @@ +## API Report File for "@azure/arm-azurestackhcivm" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +import { Client } from '@azure-rest/core-client'; +import { OperationOptions } from '@azure-rest/core-client'; +import { OperationState } from '@azure/core-lro'; +import { PollerLike } from '@azure/core-lro'; + +// @public +export function $delete(context: AzureStackHCIVMManagementContext, resourceGroupName: string, virtualHardDiskName: string, options?: VirtualHardDisksDeleteOptionalParams): PollerLike, void>; + +// @public +export function createOrUpdate(context: AzureStackHCIVMManagementContext, resourceGroupName: string, virtualHardDiskName: string, resource: VirtualHardDisk, options?: VirtualHardDisksCreateOrUpdateOptionalParams): PollerLike, VirtualHardDisk>; + +// @public +export function get(context: AzureStackHCIVMManagementContext, resourceGroupName: string, virtualHardDiskName: string, options?: VirtualHardDisksGetOptionalParams): Promise; + +// @public +export function listAll(context: AzureStackHCIVMManagementContext, options?: VirtualHardDisksListAllOptionalParams): PagedAsyncIterableIterator; + +// @public +export function listByResourceGroup(context: AzureStackHCIVMManagementContext, resourceGroupName: string, options?: VirtualHardDisksListByResourceGroupOptionalParams): PagedAsyncIterableIterator; + +// @public +export function update(context: AzureStackHCIVMManagementContext, resourceGroupName: string, virtualHardDiskName: string, properties: VirtualHardDisksUpdateRequest, options?: VirtualHardDisksUpdateOptionalParams): PollerLike, VirtualHardDisk>; + +// @public +export function upload(context: AzureStackHCIVMManagementContext, resourceGroupName: string, virtualHardDiskName: string, body: VirtualHardDiskUploadRequest, options?: VirtualHardDisksUploadOptionalParams): PollerLike, VirtualHardDiskUploadResponse>; + +// @public +export interface VirtualHardDisksCreateOrUpdateOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface VirtualHardDisksDeleteOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface VirtualHardDisksGetOptionalParams extends OperationOptions { +} + +// @public +export interface VirtualHardDisksListAllOptionalParams extends OperationOptions { +} + +// @public +export interface VirtualHardDisksListByResourceGroupOptionalParams extends OperationOptions { +} + +// @public +export interface VirtualHardDisksUpdateOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface VirtualHardDisksUploadOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// (No @packageDocumentation comment for this package) + +``` diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/review/arm-azurestackhcivm-api-virtualMachineInstances-node.api.md b/sdk/azurestackhcivm/arm-azurestackhcivm/review/arm-azurestackhcivm-api-virtualMachineInstances-node.api.md new file mode 100644 index 000000000000..ddaae2f67c28 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/review/arm-azurestackhcivm-api-virtualMachineInstances-node.api.md @@ -0,0 +1,92 @@ +## API Report File for "@azure/arm-azurestackhcivm" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +import { Client } from '@azure-rest/core-client'; +import { OperationOptions } from '@azure-rest/core-client'; +import { OperationState } from '@azure/core-lro'; +import { PollerLike } from '@azure/core-lro'; + +// @public +export function $delete(context: AzureStackHCIVMManagementContext, resourceUri: string, options?: VirtualMachineInstancesDeleteOptionalParams): PollerLike, void>; + +// @public +export function createOrUpdate(context: AzureStackHCIVMManagementContext, resourceUri: string, resource: VirtualMachineInstance, options?: VirtualMachineInstancesCreateOrUpdateOptionalParams): PollerLike, VirtualMachineInstance>; + +// @public +export function get(context: AzureStackHCIVMManagementContext, resourceUri: string, options?: VirtualMachineInstancesGetOptionalParams): Promise; + +// @public +export function list(context: AzureStackHCIVMManagementContext, resourceUri: string, options?: VirtualMachineInstancesListOptionalParams): PagedAsyncIterableIterator; + +// @public +export function pause(context: AzureStackHCIVMManagementContext, resourceUri: string, options?: VirtualMachineInstancesPauseOptionalParams): PollerLike, void>; + +// @public +export function restart(context: AzureStackHCIVMManagementContext, resourceUri: string, options?: VirtualMachineInstancesRestartOptionalParams): PollerLike, void>; + +// @public +export function save(context: AzureStackHCIVMManagementContext, resourceUri: string, options?: VirtualMachineInstancesSaveOptionalParams): PollerLike, void>; + +// @public +export function start(context: AzureStackHCIVMManagementContext, resourceUri: string, options?: VirtualMachineInstancesStartOptionalParams): PollerLike, void>; + +// @public +export function stop(context: AzureStackHCIVMManagementContext, resourceUri: string, options?: VirtualMachineInstancesStopOptionalParams): PollerLike, void>; + +// @public +export function update(context: AzureStackHCIVMManagementContext, resourceUri: string, properties: VirtualMachineInstanceUpdateRequest, options?: VirtualMachineInstancesUpdateOptionalParams): PollerLike, VirtualMachineInstance>; + +// @public +export interface VirtualMachineInstancesCreateOrUpdateOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface VirtualMachineInstancesDeleteOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface VirtualMachineInstancesGetOptionalParams extends OperationOptions { +} + +// @public +export interface VirtualMachineInstancesListOptionalParams extends OperationOptions { +} + +// @public +export interface VirtualMachineInstancesPauseOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface VirtualMachineInstancesRestartOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface VirtualMachineInstancesSaveOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface VirtualMachineInstancesStartOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface VirtualMachineInstancesStopOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface VirtualMachineInstancesUpdateOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// (No @packageDocumentation comment for this package) + +``` diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/review/arm-azurestackhcivm-models-node.api.md b/sdk/azurestackhcivm/arm-azurestackhcivm/review/arm-azurestackhcivm-models-node.api.md new file mode 100644 index 000000000000..33a4682d1a9b --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/review/arm-azurestackhcivm-models-node.api.md @@ -0,0 +1,1169 @@ +## API Report File for "@azure/arm-azurestackhcivm" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +// @public +export interface AttestationStatus extends ProxyResource { + properties?: AttestationStatusProperties; +} + +// @public +export interface AttestationStatusProperties { + readonly attestationCertValidated?: AttestCertPropertyEnum; + readonly attestDiskSecurityEncryptionType?: AttestDiskSecurityEncryptionTypeEnum; + readonly attestHardwarePlatform?: AttestHWPlatformEnum; + readonly attestSecureBootEnabled?: AttestSecureBootPropertyEnum; + readonly bootIntegrityValidated?: AttestBootIntegrityPropertyEnum; + readonly errorMessage?: string; + readonly healthStatus?: AttestHealthStatusEnum; + readonly linuxKernelVersion?: string; + readonly provisioningState?: ProvisioningStateEnum; + readonly timestamp?: string; +} + +// @public +export type AttestBootIntegrityPropertyEnum = string; + +// @public +export type AttestCertPropertyEnum = string; + +// @public +export type AttestDiskSecurityEncryptionTypeEnum = string; + +// @public +export type AttestHealthStatusEnum = string; + +// @public +export type AttestHWPlatformEnum = string; + +// @public +export type AttestSecureBootPropertyEnum = string; + +// @public +export type CloudInitDataSource = string; + +// @public +export type CreatedByType = string; + +// @public +export type DiskFileFormat = string; + +// @public +export interface ErrorAdditionalInfo { + readonly info?: any; + readonly type?: string; +} + +// @public +export interface ErrorDetail { + readonly additionalInfo?: ErrorAdditionalInfo[]; + readonly code?: string; + readonly details?: ErrorDetail[]; + readonly message?: string; + readonly target?: string; +} + +// @public +export interface ErrorResponse { + error?: ErrorDetail; +} + +// @public +export interface ExtendedLocation { + name?: string; + type?: ExtendedLocationTypes; +} + +// @public +export type ExtendedLocationTypes = string; + +// @public +export interface ExtensionResource extends Resource { +} + +// @public +export interface GalleryImage extends TrackedResource { + extendedLocation?: ExtendedLocation; + properties?: GalleryImageProperties; +} + +// @public +export interface GalleryImageIdentifier { + offer: string; + publisher: string; + sku: string; +} + +// @public +export interface GalleryImageProperties { + cloudInitDataSource?: CloudInitDataSource; + containerId?: string; + hyperVGeneration?: HyperVGeneration; + identifier?: GalleryImageIdentifier; + imagePath?: string; + osType: OperatingSystemTypes; + readonly provisioningState?: ProvisioningStateEnum; + sourceVirtualMachineId?: string; + readonly status?: GalleryImageStatus; + version?: GalleryImageVersion; + vmImageRepositoryCredentials?: VmImageRepositoryCredentials; +} + +// @public +export interface GalleryImageStatus { + downloadStatus?: GalleryImageStatusDownloadStatus; + errorCode?: string; + errorMessage?: string; + progressPercentage?: number; + provisioningStatus?: GalleryImageStatusProvisioningStatus; +} + +// @public +export interface GalleryImageStatusDownloadStatus { + downloadSizeInMB?: number; +} + +// @public +export interface GalleryImageStatusProvisioningStatus { + operationId?: string; + status?: Status; +} + +// @public +export interface GalleryImageTagsUpdate { + tags?: Record; +} + +// @public +export interface GalleryImageVersion { + name?: string; + properties?: GalleryImageVersionProperties; +} + +// @public +export interface GalleryImageVersionProperties { + storageProfile: GalleryImageVersionStorageProfile; +} + +// @public +export interface GalleryImageVersionStorageProfile { + osDiskImage?: GalleryOSDiskImage; +} + +// @public +export interface GalleryOSDiskImage { + readonly sizeInMB?: number; +} + +// @public +export type GpuAssignmentTypeEnum = string; + +// @public +export interface GuestAgent extends ProxyResource { + properties?: GuestAgentProperties; +} + +// @public +export interface GuestAgentInstallStatus { + readonly agentVersion?: string; + readonly errorDetails?: ErrorDetail[]; + readonly lastStatusChange?: Date; + readonly status?: StatusTypes; + readonly vmUuid?: string; +} + +// @public +export interface GuestAgentProperties { + credentials?: GuestCredential; + provisioningAction?: ProvisioningAction; + readonly provisioningState?: ProvisioningStateEnum; + readonly status?: string; +} + +// @public +export interface GuestCredential { + password?: string; + username?: string; +} + +// @public +export interface HardwareProfileUpdate { + memoryMB?: number; + processors?: number; + virtualMachineGPUs?: VirtualMachineInstancePropertiesHardwareProfileVirtualMachineGPU[]; + vmSize?: VmSizeEnum; +} + +// @public +export interface HttpProxyConfiguration { + httpProxy?: string; + httpsProxy?: string; + noProxy?: string[]; + trustedCa?: string; +} + +// @public +export interface HybridIdentityMetadata extends ProxyResource { + properties?: HybridIdentityMetadataProperties; +} + +// @public +export interface HybridIdentityMetadataProperties { + readonly identity?: Identity; + readonly provisioningState?: ProvisioningStateEnum; + publicKey?: string; + resourceUid?: string; +} + +// @public +export type HyperVGeneration = string; + +// @public +export interface Identity { + readonly principalId?: string; + readonly tenantId?: string; + type?: "SystemAssigned"; +} + +// @public +export interface ImageArmReference { + id?: string; +} + +// @public +export interface InstanceViewStatus { + code?: string; + displayStatus?: string; + level?: StatusLevelTypes; + message?: string; + time?: Date; +} + +// @public +export interface InterfaceDNSSettings { + dnsServers?: string[]; +} + +// @public +export type IpAllocationMethodEnum = string; + +// @public +export interface IPConfiguration { + name?: string; + properties?: IPConfigurationProperties; +} + +// @public +export interface IPConfigurationProperties { + readonly gateway?: string; + readonly prefixLength?: string; + privateIPAddress?: string; + subnet?: LogicalNetworkArmReference; +} + +// @public +export interface IPPool { + end?: string; + info?: IPPoolInfo; + ipPoolType?: IPPoolTypeEnum; + name?: string; + start?: string; +} + +// @public +export interface IPPoolInfo { + readonly available?: string; + readonly used?: string; +} + +// @public +export type IPPoolTypeEnum = string; + +// @public +export enum KnownAttestBootIntegrityPropertyEnum { + Invalid = "Invalid", + Unknown = "Unknown", + Valid = "Valid" +} + +// @public +export enum KnownAttestCertPropertyEnum { + Invalid = "Invalid", + Unknown = "Unknown", + Valid = "Valid" +} + +// @public +export enum KnownAttestDiskSecurityEncryptionTypeEnum { + NonPersistedTPM = "NonPersistedTPM", + Unknown = "Unknown" +} + +// @public +export enum KnownAttestHealthStatusEnum { + Healthy = "Healthy", + Pending = "Pending", + Unhealthy = "Unhealthy", + Unknown = "Unknown" +} + +// @public +export enum KnownAttestHWPlatformEnum { + Sevsnp = "SEVSNP", + Unknown = "Unknown" +} + +// @public +export enum KnownAttestSecureBootPropertyEnum { + Disabled = "Disabled", + Enabled = "Enabled", + Unknown = "Unknown" +} + +// @public +export enum KnownCloudInitDataSource { + Azure = "Azure", + NoCloud = "NoCloud" +} + +// @public +export enum KnownCreatedByType { + Application = "Application", + Key = "Key", + ManagedIdentity = "ManagedIdentity", + User = "User" +} + +// @public +export enum KnownDiskFileFormat { + Vhd = "vhd", + Vhdx = "vhdx" +} + +// @public +export enum KnownExtendedLocationTypes { + CustomLocation = "CustomLocation" +} + +// @public +export enum KnownGpuAssignmentTypeEnum { + GpuDDA = "GpuDDA", + GpuP = "GpuP" +} + +// @public +export enum KnownHyperVGeneration { + V1 = "V1", + V2 = "V2" +} + +// @public +export enum KnownIpAllocationMethodEnum { + Dynamic = "Dynamic", + Static = "Static" +} + +// @public +export enum KnownIPPoolTypeEnum { + Vippool = "vippool", + Vm = "vm" +} + +// @public +export enum KnownLogicalNetworkTypeEnum { + Infrastructure = "Infrastructure", + Workload = "Workload" +} + +// @public +export enum KnownManagedServiceIdentityType { + None = "None", + SystemAssigned = "SystemAssigned", + SystemAssignedUserAssigned = "SystemAssigned,UserAssigned", + UserAssigned = "UserAssigned" +} + +// @public +export enum KnownOperatingSystemTypes { + Linux = "Linux", + Windows = "Windows" +} + +// @public +export enum KnownPowerStateEnum { + Deallocated = "Deallocated", + Deallocating = "Deallocating", + Paused = "Paused", + Running = "Running", + Saved = "Saved", + Starting = "Starting", + Stopped = "Stopped", + Stopping = "Stopping", + Unknown = "Unknown" +} + +// @public +export enum KnownProvisioningAction { + Install = "install", + Repair = "repair", + Uninstall = "uninstall" +} + +// @public +export enum KnownProvisioningStateEnum { + Accepted = "Accepted", + Canceled = "Canceled", + Deleting = "Deleting", + Failed = "Failed", + InProgress = "InProgress", + Succeeded = "Succeeded" +} + +// @public +export enum KnownSecurityEncryptionType { + NonPersistedTPM = "NonPersistedTPM" +} + +// @public +export enum KnownSecurityRuleAccess { + Allow = "Allow", + Deny = "Deny" +} + +// @public +export enum KnownSecurityRuleDirection { + Inbound = "Inbound", + Outbound = "Outbound" +} + +// @public +export enum KnownSecurityRuleProtocol { + Asterisk = "*", + Icmp = "Icmp", + Tcp = "Tcp", + Udp = "Udp" +} + +// @public +export enum KnownSecurityTypes { + ConfidentialVM = "ConfidentialVM", + TrustedLaunch = "TrustedLaunch" +} + +// @public +export enum KnownStatus { + Failed = "Failed", + InProgress = "InProgress", + Succeeded = "Succeeded" +} + +// @public +export enum KnownStatusLevelTypes { + Error = "Error", + Info = "Info", + Warning = "Warning" +} + +// @public +export enum KnownStatusTypes { + Failed = "Failed", + InProgress = "InProgress", + Succeeded = "Succeeded" +} + +// @public +export enum KnownVersions { + V20240201Preview = "2024-02-01-preview", + V20240501Preview = "2024-05-01-preview", + V20240801Preview = "2024-08-01-preview", + V20241001Preview = "2024-10-01-preview", + V20250201Preview = "2025-02-01-preview", + V20250401Preview = "2025-04-01-preview", + V20250601Preview = "2025-06-01-preview" +} + +// @public +export enum KnownVmSizeEnum { + Custom = "Custom", + Default = "Default", + StandardA2V2 = "Standard_A2_v2", + StandardA4V2 = "Standard_A4_v2", + StandardD16SV3 = "Standard_D16s_v3", + StandardD2SV3 = "Standard_D2s_v3", + StandardD32SV3 = "Standard_D32s_v3", + StandardD4SV3 = "Standard_D4s_v3", + StandardD8SV3 = "Standard_D8s_v3", + StandardDS13V2 = "Standard_DS13_v2", + StandardDS2V2 = "Standard_DS2_v2", + StandardDS3V2 = "Standard_DS3_v2", + StandardDS4V2 = "Standard_DS4_v2", + StandardDS5V2 = "Standard_DS5_v2", + StandardK8S2V1 = "Standard_K8S2_v1", + StandardK8S3V1 = "Standard_K8S3_v1", + StandardK8S4V1 = "Standard_K8S4_v1", + StandardK8S5V1 = "Standard_K8S5_v1", + StandardK8SV1 = "Standard_K8S_v1", + StandardNK12 = "Standard_NK12", + StandardNK6 = "Standard_NK6", + StandardNV12 = "Standard_NV12", + StandardNV6 = "Standard_NV6" +} + +// @public +export interface LogicalNetwork extends TrackedResource { + extendedLocation?: ExtendedLocation; + properties?: LogicalNetworkProperties; +} + +// @public +export interface LogicalNetworkArmReference { + id?: string; +} + +// @public +export interface LogicalNetworkProperties { + dhcpOptions?: LogicalNetworkPropertiesDhcpOptions; + readonly networkType?: LogicalNetworkTypeEnum; + readonly provisioningState?: ProvisioningStateEnum; + readonly status?: LogicalNetworkStatus; + subnets?: Subnet[]; + vmSwitchName?: string; +} + +// @public +export interface LogicalNetworkPropertiesDhcpOptions { + dnsServers?: string[]; +} + +// @public +export interface LogicalNetworkStatus { + errorCode?: string; + errorMessage?: string; + provisioningStatus?: LogicalNetworkStatusProvisioningStatus; +} + +// @public +export interface LogicalNetworkStatusProvisioningStatus { + operationId?: string; + status?: Status; +} + +// @public +export interface LogicalNetworksUpdateRequest { + tags?: Record; +} + +// @public +export type LogicalNetworkTypeEnum = string; + +// @public +export interface ManagedServiceIdentity { + readonly principalId?: string; + readonly tenantId?: string; + type: ManagedServiceIdentityType; + userAssignedIdentities?: Record; +} + +// @public +export type ManagedServiceIdentityType = string; + +// @public +export interface MarketplaceGalleryImage extends TrackedResource { + extendedLocation?: ExtendedLocation; + properties?: MarketplaceGalleryImageProperties; +} + +// @public +export interface MarketplaceGalleryImageProperties { + cloudInitDataSource?: CloudInitDataSource; + containerId?: string; + hyperVGeneration?: HyperVGeneration; + identifier?: GalleryImageIdentifier; + osType: OperatingSystemTypes; + readonly provisioningState?: ProvisioningStateEnum; + readonly status?: MarketplaceGalleryImageStatus; + version?: GalleryImageVersion; +} + +// @public +export interface MarketplaceGalleryImageStatus { + downloadStatus?: MarketplaceGalleryImageStatusDownloadStatus; + errorCode?: string; + errorMessage?: string; + progressPercentage?: number; + provisioningStatus?: MarketplaceGalleryImageStatusProvisioningStatus; +} + +// @public +export interface MarketplaceGalleryImageStatusDownloadStatus { + downloadSizeInMB?: number; +} + +// @public +export interface MarketplaceGalleryImageStatusProvisioningStatus { + operationId?: string; + status?: Status; +} + +// @public +export interface MarketplaceGalleryImageTagsUpdate { + tags?: Record; +} + +// @public +export interface NetworkInterface extends TrackedResource { + extendedLocation?: ExtendedLocation; + properties?: NetworkInterfaceProperties; +} + +// @public +export interface NetworkInterfaceArmReference { + id?: string; +} + +// @public +export interface NetworkInterfaceProperties { + createFromLocal?: boolean; + dnsSettings?: InterfaceDNSSettings; + ipConfigurations?: IPConfiguration[]; + macAddress?: string; + networkSecurityGroup?: NetworkSecurityGroupArmReference; + readonly provisioningState?: ProvisioningStateEnum; + readonly status?: NetworkInterfaceStatus; +} + +// @public +export interface NetworkInterfaceStatus { + errorCode?: string; + errorMessage?: string; + provisioningStatus?: NetworkInterfaceStatusProvisioningStatus; +} + +// @public +export interface NetworkInterfaceStatusProvisioningStatus { + operationId?: string; + status?: Status; +} + +// @public +export interface NetworkInterfacesUpdateProperties { + dnsSettings?: InterfaceDNSSettings; + networkSecurityGroup?: NetworkSecurityGroupArmReference; +} + +// @public +export interface NetworkInterfacesUpdateRequest { + properties?: NetworkInterfacesUpdateProperties; + tags?: Record; +} + +// @public +export interface NetworkProfileUpdate { + networkInterfaces?: NetworkInterfaceArmReference[]; +} + +// @public +export interface NetworkSecurityGroup extends TrackedResource { + readonly eTag?: string; + extendedLocation?: ExtendedLocation; + properties?: NetworkSecurityGroupProperties; +} + +// @public +export interface NetworkSecurityGroupArmReference { + id?: string; +} + +// @public +export interface NetworkSecurityGroupProperties { + readonly networkInterfaces?: NetworkInterfaceArmReference[]; + readonly provisioningState?: ProvisioningStateEnum; + readonly status?: NetworkSecurityGroupStatus; + readonly subnets?: LogicalNetworkArmReference[]; +} + +// @public +export interface NetworkSecurityGroupStatus { + errorCode?: string; + errorMessage?: string; + provisioningStatus?: NetworkSecurityGroupStatusProvisioningStatus; +} + +// @public +export interface NetworkSecurityGroupStatusProvisioningStatus { + operationId?: string; + status?: Status; +} + +// @public +export interface NetworkSecurityGroupTagsUpdate { + tags?: Record; +} + +// @public +export type OperatingSystemTypes = string; + +// @public +export interface OsProfileUpdate { + computerName?: string; + linuxConfiguration?: OsProfileUpdateLinuxConfiguration; + windowsConfiguration?: OsProfileUpdateWindowsConfiguration; +} + +// @public +export interface OsProfileUpdateLinuxConfiguration { + provisionVMAgent?: boolean; + provisionVMConfigAgent?: boolean; +} + +// @public +export interface OsProfileUpdateWindowsConfiguration { + provisionVMAgent?: boolean; + provisionVMConfigAgent?: boolean; +} + +// @public +export type PowerStateEnum = string; + +// @public +export type ProvisioningAction = string; + +// @public +export type ProvisioningStateEnum = string; + +// @public +export interface ProxyResource extends Resource { +} + +// @public +export interface Resource { + readonly id?: string; + readonly name?: string; + readonly systemData?: SystemData; + readonly type?: string; +} + +// @public +export interface Route { + name?: string; + properties?: RouteProperties; +} + +// @public +export interface RouteProperties { + addressPrefix?: string; + nextHopIpAddress?: string; +} + +// @public +export interface RouteTable { + readonly etag?: string; + readonly name?: string; + properties?: RouteTableProperties; + readonly type?: string; +} + +// @public +export interface RouteTableProperties { + routes?: Route[]; +} + +// @public +export type SecurityEncryptionType = string; + +// @public +export interface SecurityRule extends ProxyResource { + extendedLocation?: ExtendedLocation; + properties?: SecurityRuleProperties; +} + +// @public +export type SecurityRuleAccess = string; + +// @public +export type SecurityRuleDirection = string; + +// @public +export interface SecurityRuleProperties { + access: SecurityRuleAccess; + description?: string; + destinationAddressPrefixes?: string[]; + destinationPortRanges?: string[]; + direction: SecurityRuleDirection; + priority: number; + protocol: SecurityRuleProtocol; + readonly provisioningState?: ProvisioningStateEnum; + sourceAddressPrefixes?: string[]; + sourcePortRanges?: string[]; +} + +// @public +export type SecurityRuleProtocol = string; + +// @public +export type SecurityTypes = string; + +// @public +export interface SshConfiguration { + publicKeys?: SshPublicKey[]; +} + +// @public +export interface SshPublicKey { + keyData?: string; + path?: string; +} + +// @public +export type Status = string; + +// @public +export type StatusLevelTypes = string; + +// @public +export type StatusTypes = string; + +// @public +export interface StorageContainer extends TrackedResource { + extendedLocation?: ExtendedLocation; + properties?: StorageContainerProperties; +} + +// @public +export interface StorageContainerProperties { + path: string; + readonly provisioningState?: ProvisioningStateEnum; + readonly status?: StorageContainerStatus; +} + +// @public +export interface StorageContainerStatus { + availableSizeMB?: number; + containerSizeMB?: number; + errorCode?: string; + errorMessage?: string; + provisioningStatus?: StorageContainerStatusProvisioningStatus; +} + +// @public +export interface StorageContainerStatusProvisioningStatus { + operationId?: string; + status?: Status; +} + +// @public +export interface StorageContainerTagsUpdate { + tags?: Record; +} + +// @public +export interface StorageProfileUpdate { + dataDisks?: VirtualHardDiskArmReference[]; +} + +// @public +export interface Subnet { + name?: string; + properties?: SubnetProperties; +} + +// @public +export interface SubnetIpConfigurationReference { + id?: string; +} + +// @public +export interface SubnetProperties { + addressPrefix?: string; + addressPrefixes?: string[]; + ipAllocationMethod?: IpAllocationMethodEnum; + ipConfigurationReferences?: SubnetIpConfigurationReference[]; + ipPools?: IPPool[]; + networkSecurityGroup?: NetworkSecurityGroupArmReference; + routeTable?: RouteTable; + vlan?: number; +} + +// @public +export interface SystemData { + createdAt?: Date; + createdBy?: string; + createdByType?: CreatedByType; + lastModifiedAt?: Date; + lastModifiedBy?: string; + lastModifiedByType?: CreatedByType; +} + +// @public +export interface TrackedResource extends Resource { + location: string; + tags?: Record; +} + +// @public +export interface UserAssignedIdentity { + readonly clientId?: string; + readonly principalId?: string; +} + +// @public +export interface VirtualHardDisk extends TrackedResource { + extendedLocation?: ExtendedLocation; + properties?: VirtualHardDiskProperties; +} + +// @public +export interface VirtualHardDiskArmReference { + id?: string; +} + +// @public +export interface VirtualHardDiskDownloadStatus { + downloadedSizeInMB?: number; + progressPercentage?: number; + status?: Status; +} + +// @public +export interface VirtualHardDiskProperties { + blockSizeBytes?: number; + containerId?: string; + createFromLocal?: boolean; + diskFileFormat?: DiskFileFormat; + diskSizeGB?: number; + downloadUrl?: string; + dynamic?: boolean; + hyperVGeneration?: HyperVGeneration; + logicalSectorBytes?: number; + maxShares?: number; + physicalSectorBytes?: number; + readonly provisioningState?: ProvisioningStateEnum; + readonly status?: VirtualHardDiskStatus; +} + +// @public +export interface VirtualHardDiskStatus { + downloadStatus?: VirtualHardDiskDownloadStatus; + errorCode?: string; + errorMessage?: string; + managedBy?: string[]; + provisioningStatus?: VirtualHardDiskStatusProvisioningStatus; + uniqueId?: string; + uploadStatus?: VirtualHardDiskUploadStatus; +} + +// @public +export interface VirtualHardDiskStatusProvisioningStatus { + operationId?: string; + status?: Status; +} + +// @public +export interface VirtualHardDisksUpdateProperties { + diskSizeGB?: number; +} + +// @public +export interface VirtualHardDisksUpdateRequest { + properties?: VirtualHardDisksUpdateProperties; + tags?: Record; +} + +// @public +export interface VirtualHardDiskUploadRequest { + azureManagedDiskUploadUrl: string; +} + +// @public +export interface VirtualHardDiskUploadResponse { + uploadStatus?: VirtualHardDiskUploadStatus; + virtualHardDiskId?: string; +} + +// @public +export interface VirtualHardDiskUploadStatus { + errorCode?: string; + errorMessage?: string; + progressPercentage?: number; + status?: Status; + uploadedSizeInMB?: number; +} + +// @public +export interface VirtualMachineConfigAgentInstanceView { + statuses?: InstanceViewStatus[]; + vmConfigAgentVersion?: string; +} + +// @public +export interface VirtualMachineInstance extends ExtensionResource { + extendedLocation?: ExtendedLocation; + identity?: ManagedServiceIdentity; + properties?: VirtualMachineInstanceProperties; +} + +// @public +export interface VirtualMachineInstanceManagedDiskParameters { + securityProfile?: VMDiskSecurityProfile; +} + +// @public +export interface VirtualMachineInstanceProperties { + createFromLocal?: boolean; + guestAgentInstallStatus?: GuestAgentInstallStatus; + hardwareProfile?: VirtualMachineInstancePropertiesHardwareProfile; + readonly hostNodeIpAddress?: string; + readonly hostNodeName?: string; + httpProxyConfig?: HttpProxyConfiguration; + readonly hyperVVmId?: string; + readonly instanceView?: VirtualMachineInstanceView; + networkProfile?: VirtualMachineInstancePropertiesNetworkProfile; + osProfile?: VirtualMachineInstancePropertiesOsProfile; + placementProfile?: VirtualMachineInstancePropertiesPlacementProfile; + readonly provisioningState?: ProvisioningStateEnum; + resourceUid?: string; + securityProfile?: VirtualMachineInstancePropertiesSecurityProfile; + readonly status?: VirtualMachineInstanceStatus; + storageProfile?: VirtualMachineInstancePropertiesStorageProfile; + readonly vmId?: string; +} + +// @public +export interface VirtualMachineInstancePropertiesHardwareProfile { + dynamicMemoryConfig?: VirtualMachineInstancePropertiesHardwareProfileDynamicMemoryConfig; + memoryMB?: number; + processors?: number; + virtualMachineGPUs?: VirtualMachineInstancePropertiesHardwareProfileVirtualMachineGPU[]; + vmSize?: VmSizeEnum; +} + +// @public +export interface VirtualMachineInstancePropertiesHardwareProfileDynamicMemoryConfig { + maximumMemoryMB?: number; + minimumMemoryMB?: number; + targetMemoryBuffer?: number; +} + +// @public +export interface VirtualMachineInstancePropertiesHardwareProfileVirtualMachineGPU { + assignmentType: GpuAssignmentTypeEnum; + gpuName?: string; + partitionSizeMB?: number; +} + +// @public +export interface VirtualMachineInstancePropertiesNetworkProfile { + networkInterfaces?: NetworkInterfaceArmReference[]; +} + +// @public +export interface VirtualMachineInstancePropertiesOsProfile { + adminPassword?: string; + adminUsername?: string; + computerName?: string; + linuxConfiguration?: VirtualMachineInstancePropertiesOsProfileLinuxConfiguration; + windowsConfiguration?: VirtualMachineInstancePropertiesOsProfileWindowsConfiguration; +} + +// @public +export interface VirtualMachineInstancePropertiesOsProfileLinuxConfiguration { + disablePasswordAuthentication?: boolean; + provisionVMAgent?: boolean; + provisionVMConfigAgent?: boolean; + ssh?: SshConfiguration; +} + +// @public +export interface VirtualMachineInstancePropertiesOsProfileWindowsConfiguration { + enableAutomaticUpdates?: boolean; + provisionVMAgent?: boolean; + provisionVMConfigAgent?: boolean; + ssh?: SshConfiguration; + timeZone?: string; +} + +// @public +export interface VirtualMachineInstancePropertiesPlacementProfile { + strictPlacementPolicy?: boolean; + zone?: string; +} + +// @public +export interface VirtualMachineInstancePropertiesSecurityProfile { + enableTPM?: boolean; + securityType?: SecurityTypes; + uefiSettings?: VirtualMachineInstancePropertiesSecurityProfileUefiSettings; +} + +// @public +export interface VirtualMachineInstancePropertiesSecurityProfileUefiSettings { + secureBootEnabled?: boolean; +} + +// @public +export interface VirtualMachineInstancePropertiesStorageProfile { + dataDisks?: VirtualHardDiskArmReference[]; + imageReference?: ImageArmReference; + osDisk?: VirtualMachineInstancePropertiesStorageProfileOsDisk; + vmConfigStoragePathId?: string; +} + +// @public +export interface VirtualMachineInstancePropertiesStorageProfileOsDisk { + id?: string; + managedDisk?: VirtualMachineInstanceManagedDiskParameters; + osType?: OperatingSystemTypes; +} + +// @public +export interface VirtualMachineInstanceStatus { + errorCode?: string; + errorMessage?: string; + powerState?: PowerStateEnum; + provisioningStatus?: VirtualMachineInstanceStatusProvisioningStatus; +} + +// @public +export interface VirtualMachineInstanceStatusProvisioningStatus { + operationId?: string; + status?: Status; +} + +// @public +export interface VirtualMachineInstanceUpdateProperties { + hardwareProfile?: HardwareProfileUpdate; + networkProfile?: NetworkProfileUpdate; + osProfile?: OsProfileUpdate; + storageProfile?: StorageProfileUpdate; +} + +// @public +export interface VirtualMachineInstanceUpdateRequest { + identity?: Identity; + properties?: VirtualMachineInstanceUpdateProperties; +} + +// @public +export interface VirtualMachineInstanceView { + vmAgent?: VirtualMachineConfigAgentInstanceView; +} + +// @public +export interface VMDiskSecurityProfile { + securityEncryptionType?: SecurityEncryptionType; +} + +// @public +export interface VmImageRepositoryCredentials { + password: string; + username: string; +} + +// @public +export type VmSizeEnum = string; + +// (No @packageDocumentation comment for this package) + +``` diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/review/arm-azurestackhcivm-node.api.md b/sdk/azurestackhcivm/arm-azurestackhcivm/review/arm-azurestackhcivm-node.api.md new file mode 100644 index 000000000000..2c9fd5a9f485 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/review/arm-azurestackhcivm-node.api.md @@ -0,0 +1,1641 @@ +## API Report File for "@azure/arm-azurestackhcivm" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +import { AbortSignalLike } from '@azure/abort-controller'; +import { ClientOptions } from '@azure-rest/core-client'; +import { OperationOptions } from '@azure-rest/core-client'; +import { OperationState } from '@azure/core-lro'; +import { PathUncheckedResponse } from '@azure-rest/core-client'; +import { Pipeline } from '@azure/core-rest-pipeline'; +import { PollerLike } from '@azure/core-lro'; +import { TokenCredential } from '@azure/core-auth'; + +// @public +export interface AttestationStatus extends ProxyResource { + properties?: AttestationStatusProperties; +} + +// @public +export interface AttestationStatusesGetOptionalParams extends OperationOptions { +} + +// @public +export interface AttestationStatusesOperations { + get: (resourceUri: string, options?: AttestationStatusesGetOptionalParams) => Promise; +} + +// @public +export interface AttestationStatusProperties { + readonly attestationCertValidated?: AttestCertPropertyEnum; + readonly attestDiskSecurityEncryptionType?: AttestDiskSecurityEncryptionTypeEnum; + readonly attestHardwarePlatform?: AttestHWPlatformEnum; + readonly attestSecureBootEnabled?: AttestSecureBootPropertyEnum; + readonly bootIntegrityValidated?: AttestBootIntegrityPropertyEnum; + readonly errorMessage?: string; + readonly healthStatus?: AttestHealthStatusEnum; + readonly linuxKernelVersion?: string; + readonly provisioningState?: ProvisioningStateEnum; + readonly timestamp?: string; +} + +// @public +export type AttestBootIntegrityPropertyEnum = string; + +// @public +export type AttestCertPropertyEnum = string; + +// @public +export type AttestDiskSecurityEncryptionTypeEnum = string; + +// @public +export type AttestHealthStatusEnum = string; + +// @public +export type AttestHWPlatformEnum = string; + +// @public +export type AttestSecureBootPropertyEnum = string; + +// @public +export enum AzureClouds { + AZURE_CHINA_CLOUD = "AZURE_CHINA_CLOUD", + AZURE_PUBLIC_CLOUD = "AZURE_PUBLIC_CLOUD", + AZURE_US_GOVERNMENT = "AZURE_US_GOVERNMENT" +} + +// @public (undocumented) +export class AzureStackHCIVMManagementClient { + constructor(credential: TokenCredential, subscriptionId: string, options?: AzureStackHCIVMManagementClientOptionalParams); + readonly attestationStatuses: AttestationStatusesOperations; + readonly galleryImages: GalleryImagesOperations; + readonly guestAgents: GuestAgentsOperations; + readonly hybridIdentityMetadata: HybridIdentityMetadataOperations; + readonly logicalNetworks: LogicalNetworksOperations; + readonly marketplaceGalleryImages: MarketplaceGalleryImagesOperations; + readonly networkInterfaces: NetworkInterfacesOperations; + readonly networkSecurityGroups: NetworkSecurityGroupsOperations; + readonly pipeline: Pipeline; + readonly securityRules: SecurityRulesOperations; + readonly storageContainers: StorageContainersOperations; + readonly virtualHardDisks: VirtualHardDisksOperations; + readonly virtualMachineInstances: VirtualMachineInstancesOperations; +} + +// @public +export interface AzureStackHCIVMManagementClientOptionalParams extends ClientOptions { + apiVersion?: string; + cloudSetting?: AzureSupportedClouds; +} + +// @public +export type AzureSupportedClouds = `${AzureClouds}`; + +// @public +export type CloudInitDataSource = string; + +// @public +export type ContinuablePage = TPage & { + continuationToken?: string; +}; + +// @public +export type CreatedByType = string; + +// @public +export type DiskFileFormat = string; + +// @public +export interface ErrorAdditionalInfo { + readonly info?: any; + readonly type?: string; +} + +// @public +export interface ErrorDetail { + readonly additionalInfo?: ErrorAdditionalInfo[]; + readonly code?: string; + readonly details?: ErrorDetail[]; + readonly message?: string; + readonly target?: string; +} + +// @public +export interface ErrorResponse { + error?: ErrorDetail; +} + +// @public +export interface ExtendedLocation { + name?: string; + type?: ExtendedLocationTypes; +} + +// @public +export type ExtendedLocationTypes = string; + +// @public +export interface ExtensionResource extends Resource { +} + +// @public +export interface GalleryImage extends TrackedResource { + extendedLocation?: ExtendedLocation; + properties?: GalleryImageProperties; +} + +// @public +export interface GalleryImageIdentifier { + offer: string; + publisher: string; + sku: string; +} + +// @public +export interface GalleryImageProperties { + cloudInitDataSource?: CloudInitDataSource; + containerId?: string; + hyperVGeneration?: HyperVGeneration; + identifier?: GalleryImageIdentifier; + imagePath?: string; + osType: OperatingSystemTypes; + readonly provisioningState?: ProvisioningStateEnum; + sourceVirtualMachineId?: string; + readonly status?: GalleryImageStatus; + version?: GalleryImageVersion; + vmImageRepositoryCredentials?: VmImageRepositoryCredentials; +} + +// @public +export interface GalleryImagesCreateOrUpdateOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface GalleryImagesDeleteOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface GalleryImagesGetOptionalParams extends OperationOptions { +} + +// @public +export interface GalleryImagesListAllOptionalParams extends OperationOptions { +} + +// @public +export interface GalleryImagesListByResourceGroupOptionalParams extends OperationOptions { +} + +// @public +export interface GalleryImagesOperations { + createOrUpdate: (resourceGroupName: string, galleryImageName: string, resource: GalleryImage, options?: GalleryImagesCreateOrUpdateOptionalParams) => PollerLike, GalleryImage>; + delete: (resourceGroupName: string, galleryImageName: string, options?: GalleryImagesDeleteOptionalParams) => PollerLike, void>; + get: (resourceGroupName: string, galleryImageName: string, options?: GalleryImagesGetOptionalParams) => Promise; + listAll: (options?: GalleryImagesListAllOptionalParams) => PagedAsyncIterableIterator; + listByResourceGroup: (resourceGroupName: string, options?: GalleryImagesListByResourceGroupOptionalParams) => PagedAsyncIterableIterator; + update: (resourceGroupName: string, galleryImageName: string, properties: GalleryImageTagsUpdate, options?: GalleryImagesUpdateOptionalParams) => PollerLike, GalleryImage>; +} + +// @public +export interface GalleryImageStatus { + downloadStatus?: GalleryImageStatusDownloadStatus; + errorCode?: string; + errorMessage?: string; + progressPercentage?: number; + provisioningStatus?: GalleryImageStatusProvisioningStatus; +} + +// @public +export interface GalleryImageStatusDownloadStatus { + downloadSizeInMB?: number; +} + +// @public +export interface GalleryImageStatusProvisioningStatus { + operationId?: string; + status?: Status; +} + +// @public +export interface GalleryImagesUpdateOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface GalleryImageTagsUpdate { + tags?: Record; +} + +// @public +export interface GalleryImageVersion { + name?: string; + properties?: GalleryImageVersionProperties; +} + +// @public +export interface GalleryImageVersionProperties { + storageProfile: GalleryImageVersionStorageProfile; +} + +// @public +export interface GalleryImageVersionStorageProfile { + osDiskImage?: GalleryOSDiskImage; +} + +// @public +export interface GalleryOSDiskImage { + readonly sizeInMB?: number; +} + +// @public +export type GpuAssignmentTypeEnum = string; + +// @public +export interface GuestAgent extends ProxyResource { + properties?: GuestAgentProperties; +} + +// @public +export interface GuestAgentInstallStatus { + readonly agentVersion?: string; + readonly errorDetails?: ErrorDetail[]; + readonly lastStatusChange?: Date; + readonly status?: StatusTypes; + readonly vmUuid?: string; +} + +// @public +export interface GuestAgentProperties { + credentials?: GuestCredential; + provisioningAction?: ProvisioningAction; + readonly provisioningState?: ProvisioningStateEnum; + readonly status?: string; +} + +// @public +export interface GuestAgentsCreateOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface GuestAgentsDeleteOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface GuestAgentsGetOptionalParams extends OperationOptions { +} + +// @public +export interface GuestAgentsListByVirtualMachineInstanceOptionalParams extends OperationOptions { +} + +// @public +export interface GuestAgentsOperations { + create: (resourceUri: string, resource: GuestAgent, options?: GuestAgentsCreateOptionalParams) => PollerLike, GuestAgent>; + delete: (resourceUri: string, options?: GuestAgentsDeleteOptionalParams) => PollerLike, void>; + get: (resourceUri: string, options?: GuestAgentsGetOptionalParams) => Promise; + listByVirtualMachineInstance: (resourceUri: string, options?: GuestAgentsListByVirtualMachineInstanceOptionalParams) => PagedAsyncIterableIterator; +} + +// @public +export interface GuestCredential { + password?: string; + username?: string; +} + +// @public +export interface HardwareProfileUpdate { + memoryMB?: number; + processors?: number; + virtualMachineGPUs?: VirtualMachineInstancePropertiesHardwareProfileVirtualMachineGPU[]; + vmSize?: VmSizeEnum; +} + +// @public +export interface HttpProxyConfiguration { + httpProxy?: string; + httpsProxy?: string; + noProxy?: string[]; + trustedCa?: string; +} + +// @public +export interface HybridIdentityMetadata extends ProxyResource { + properties?: HybridIdentityMetadataProperties; +} + +// @public +export interface HybridIdentityMetadataGetOptionalParams extends OperationOptions { +} + +// @public +export interface HybridIdentityMetadataListByVirtualMachineInstanceOptionalParams extends OperationOptions { +} + +// @public +export interface HybridIdentityMetadataOperations { + get: (resourceUri: string, options?: HybridIdentityMetadataGetOptionalParams) => Promise; + listByVirtualMachineInstance: (resourceUri: string, options?: HybridIdentityMetadataListByVirtualMachineInstanceOptionalParams) => PagedAsyncIterableIterator; +} + +// @public +export interface HybridIdentityMetadataProperties { + readonly identity?: Identity; + readonly provisioningState?: ProvisioningStateEnum; + publicKey?: string; + resourceUid?: string; +} + +// @public +export type HyperVGeneration = string; + +// @public +export interface Identity { + readonly principalId?: string; + readonly tenantId?: string; + type?: "SystemAssigned"; +} + +// @public +export interface ImageArmReference { + id?: string; +} + +// @public +export interface InstanceViewStatus { + code?: string; + displayStatus?: string; + level?: StatusLevelTypes; + message?: string; + time?: Date; +} + +// @public +export interface InterfaceDNSSettings { + dnsServers?: string[]; +} + +// @public +export type IpAllocationMethodEnum = string; + +// @public +export interface IPConfiguration { + name?: string; + properties?: IPConfigurationProperties; +} + +// @public +export interface IPConfigurationProperties { + readonly gateway?: string; + readonly prefixLength?: string; + privateIPAddress?: string; + subnet?: LogicalNetworkArmReference; +} + +// @public +export interface IPPool { + end?: string; + info?: IPPoolInfo; + ipPoolType?: IPPoolTypeEnum; + name?: string; + start?: string; +} + +// @public +export interface IPPoolInfo { + readonly available?: string; + readonly used?: string; +} + +// @public +export type IPPoolTypeEnum = string; + +// @public +export enum KnownAttestBootIntegrityPropertyEnum { + Invalid = "Invalid", + Unknown = "Unknown", + Valid = "Valid" +} + +// @public +export enum KnownAttestCertPropertyEnum { + Invalid = "Invalid", + Unknown = "Unknown", + Valid = "Valid" +} + +// @public +export enum KnownAttestDiskSecurityEncryptionTypeEnum { + NonPersistedTPM = "NonPersistedTPM", + Unknown = "Unknown" +} + +// @public +export enum KnownAttestHealthStatusEnum { + Healthy = "Healthy", + Pending = "Pending", + Unhealthy = "Unhealthy", + Unknown = "Unknown" +} + +// @public +export enum KnownAttestHWPlatformEnum { + Sevsnp = "SEVSNP", + Unknown = "Unknown" +} + +// @public +export enum KnownAttestSecureBootPropertyEnum { + Disabled = "Disabled", + Enabled = "Enabled", + Unknown = "Unknown" +} + +// @public +export enum KnownCloudInitDataSource { + Azure = "Azure", + NoCloud = "NoCloud" +} + +// @public +export enum KnownCreatedByType { + Application = "Application", + Key = "Key", + ManagedIdentity = "ManagedIdentity", + User = "User" +} + +// @public +export enum KnownDiskFileFormat { + Vhd = "vhd", + Vhdx = "vhdx" +} + +// @public +export enum KnownExtendedLocationTypes { + CustomLocation = "CustomLocation" +} + +// @public +export enum KnownGpuAssignmentTypeEnum { + GpuDDA = "GpuDDA", + GpuP = "GpuP" +} + +// @public +export enum KnownHyperVGeneration { + V1 = "V1", + V2 = "V2" +} + +// @public +export enum KnownIpAllocationMethodEnum { + Dynamic = "Dynamic", + Static = "Static" +} + +// @public +export enum KnownIPPoolTypeEnum { + Vippool = "vippool", + Vm = "vm" +} + +// @public +export enum KnownLogicalNetworkTypeEnum { + Infrastructure = "Infrastructure", + Workload = "Workload" +} + +// @public +export enum KnownManagedServiceIdentityType { + None = "None", + SystemAssigned = "SystemAssigned", + SystemAssignedUserAssigned = "SystemAssigned,UserAssigned", + UserAssigned = "UserAssigned" +} + +// @public +export enum KnownOperatingSystemTypes { + Linux = "Linux", + Windows = "Windows" +} + +// @public +export enum KnownPowerStateEnum { + Deallocated = "Deallocated", + Deallocating = "Deallocating", + Paused = "Paused", + Running = "Running", + Saved = "Saved", + Starting = "Starting", + Stopped = "Stopped", + Stopping = "Stopping", + Unknown = "Unknown" +} + +// @public +export enum KnownProvisioningAction { + Install = "install", + Repair = "repair", + Uninstall = "uninstall" +} + +// @public +export enum KnownProvisioningStateEnum { + Accepted = "Accepted", + Canceled = "Canceled", + Deleting = "Deleting", + Failed = "Failed", + InProgress = "InProgress", + Succeeded = "Succeeded" +} + +// @public +export enum KnownSecurityEncryptionType { + NonPersistedTPM = "NonPersistedTPM" +} + +// @public +export enum KnownSecurityRuleAccess { + Allow = "Allow", + Deny = "Deny" +} + +// @public +export enum KnownSecurityRuleDirection { + Inbound = "Inbound", + Outbound = "Outbound" +} + +// @public +export enum KnownSecurityRuleProtocol { + Asterisk = "*", + Icmp = "Icmp", + Tcp = "Tcp", + Udp = "Udp" +} + +// @public +export enum KnownSecurityTypes { + ConfidentialVM = "ConfidentialVM", + TrustedLaunch = "TrustedLaunch" +} + +// @public +export enum KnownStatus { + Failed = "Failed", + InProgress = "InProgress", + Succeeded = "Succeeded" +} + +// @public +export enum KnownStatusLevelTypes { + Error = "Error", + Info = "Info", + Warning = "Warning" +} + +// @public +export enum KnownStatusTypes { + Failed = "Failed", + InProgress = "InProgress", + Succeeded = "Succeeded" +} + +// @public +export enum KnownVersions { + V20240201Preview = "2024-02-01-preview", + V20240501Preview = "2024-05-01-preview", + V20240801Preview = "2024-08-01-preview", + V20241001Preview = "2024-10-01-preview", + V20250201Preview = "2025-02-01-preview", + V20250401Preview = "2025-04-01-preview", + V20250601Preview = "2025-06-01-preview" +} + +// @public +export enum KnownVmSizeEnum { + Custom = "Custom", + Default = "Default", + StandardA2V2 = "Standard_A2_v2", + StandardA4V2 = "Standard_A4_v2", + StandardD16SV3 = "Standard_D16s_v3", + StandardD2SV3 = "Standard_D2s_v3", + StandardD32SV3 = "Standard_D32s_v3", + StandardD4SV3 = "Standard_D4s_v3", + StandardD8SV3 = "Standard_D8s_v3", + StandardDS13V2 = "Standard_DS13_v2", + StandardDS2V2 = "Standard_DS2_v2", + StandardDS3V2 = "Standard_DS3_v2", + StandardDS4V2 = "Standard_DS4_v2", + StandardDS5V2 = "Standard_DS5_v2", + StandardK8S2V1 = "Standard_K8S2_v1", + StandardK8S3V1 = "Standard_K8S3_v1", + StandardK8S4V1 = "Standard_K8S4_v1", + StandardK8S5V1 = "Standard_K8S5_v1", + StandardK8SV1 = "Standard_K8S_v1", + StandardNK12 = "Standard_NK12", + StandardNK6 = "Standard_NK6", + StandardNV12 = "Standard_NV12", + StandardNV6 = "Standard_NV6" +} + +// @public +export interface LogicalNetwork extends TrackedResource { + extendedLocation?: ExtendedLocation; + properties?: LogicalNetworkProperties; +} + +// @public +export interface LogicalNetworkArmReference { + id?: string; +} + +// @public +export interface LogicalNetworkProperties { + dhcpOptions?: LogicalNetworkPropertiesDhcpOptions; + readonly networkType?: LogicalNetworkTypeEnum; + readonly provisioningState?: ProvisioningStateEnum; + readonly status?: LogicalNetworkStatus; + subnets?: Subnet[]; + vmSwitchName?: string; +} + +// @public +export interface LogicalNetworkPropertiesDhcpOptions { + dnsServers?: string[]; +} + +// @public +export interface LogicalNetworksCreateOrUpdateOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface LogicalNetworksDeleteOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface LogicalNetworksGetOptionalParams extends OperationOptions { +} + +// @public +export interface LogicalNetworksListAllOptionalParams extends OperationOptions { +} + +// @public +export interface LogicalNetworksListByResourceGroupOptionalParams extends OperationOptions { +} + +// @public +export interface LogicalNetworksOperations { + createOrUpdate: (resourceGroupName: string, logicalNetworkName: string, resource: LogicalNetwork, options?: LogicalNetworksCreateOrUpdateOptionalParams) => PollerLike, LogicalNetwork>; + delete: (resourceGroupName: string, logicalNetworkName: string, options?: LogicalNetworksDeleteOptionalParams) => PollerLike, void>; + get: (resourceGroupName: string, logicalNetworkName: string, options?: LogicalNetworksGetOptionalParams) => Promise; + listAll: (options?: LogicalNetworksListAllOptionalParams) => PagedAsyncIterableIterator; + listByResourceGroup: (resourceGroupName: string, options?: LogicalNetworksListByResourceGroupOptionalParams) => PagedAsyncIterableIterator; + update: (resourceGroupName: string, logicalNetworkName: string, properties: LogicalNetworksUpdateRequest, options?: LogicalNetworksUpdateOptionalParams) => PollerLike, LogicalNetwork>; +} + +// @public +export interface LogicalNetworkStatus { + errorCode?: string; + errorMessage?: string; + provisioningStatus?: LogicalNetworkStatusProvisioningStatus; +} + +// @public +export interface LogicalNetworkStatusProvisioningStatus { + operationId?: string; + status?: Status; +} + +// @public +export interface LogicalNetworksUpdateOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface LogicalNetworksUpdateRequest { + tags?: Record; +} + +// @public +export type LogicalNetworkTypeEnum = string; + +// @public +export interface ManagedServiceIdentity { + readonly principalId?: string; + readonly tenantId?: string; + type: ManagedServiceIdentityType; + userAssignedIdentities?: Record; +} + +// @public +export type ManagedServiceIdentityType = string; + +// @public +export interface MarketplaceGalleryImage extends TrackedResource { + extendedLocation?: ExtendedLocation; + properties?: MarketplaceGalleryImageProperties; +} + +// @public +export interface MarketplaceGalleryImageProperties { + cloudInitDataSource?: CloudInitDataSource; + containerId?: string; + hyperVGeneration?: HyperVGeneration; + identifier?: GalleryImageIdentifier; + osType: OperatingSystemTypes; + readonly provisioningState?: ProvisioningStateEnum; + readonly status?: MarketplaceGalleryImageStatus; + version?: GalleryImageVersion; +} + +// @public +export interface MarketplaceGalleryImagesCreateOrUpdateOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface MarketplaceGalleryImagesDeleteOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface MarketplaceGalleryImagesGetOptionalParams extends OperationOptions { +} + +// @public +export interface MarketplaceGalleryImagesListAllOptionalParams extends OperationOptions { +} + +// @public +export interface MarketplaceGalleryImagesListByResourceGroupOptionalParams extends OperationOptions { +} + +// @public +export interface MarketplaceGalleryImagesOperations { + createOrUpdate: (resourceGroupName: string, marketplaceGalleryImageName: string, resource: MarketplaceGalleryImage, options?: MarketplaceGalleryImagesCreateOrUpdateOptionalParams) => PollerLike, MarketplaceGalleryImage>; + delete: (resourceGroupName: string, marketplaceGalleryImageName: string, options?: MarketplaceGalleryImagesDeleteOptionalParams) => PollerLike, void>; + get: (resourceGroupName: string, marketplaceGalleryImageName: string, options?: MarketplaceGalleryImagesGetOptionalParams) => Promise; + listAll: (options?: MarketplaceGalleryImagesListAllOptionalParams) => PagedAsyncIterableIterator; + listByResourceGroup: (resourceGroupName: string, options?: MarketplaceGalleryImagesListByResourceGroupOptionalParams) => PagedAsyncIterableIterator; + update: (resourceGroupName: string, marketplaceGalleryImageName: string, properties: MarketplaceGalleryImageTagsUpdate, options?: MarketplaceGalleryImagesUpdateOptionalParams) => PollerLike, MarketplaceGalleryImage>; +} + +// @public +export interface MarketplaceGalleryImageStatus { + downloadStatus?: MarketplaceGalleryImageStatusDownloadStatus; + errorCode?: string; + errorMessage?: string; + progressPercentage?: number; + provisioningStatus?: MarketplaceGalleryImageStatusProvisioningStatus; +} + +// @public +export interface MarketplaceGalleryImageStatusDownloadStatus { + downloadSizeInMB?: number; +} + +// @public +export interface MarketplaceGalleryImageStatusProvisioningStatus { + operationId?: string; + status?: Status; +} + +// @public +export interface MarketplaceGalleryImagesUpdateOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface MarketplaceGalleryImageTagsUpdate { + tags?: Record; +} + +// @public +export interface NetworkInterface extends TrackedResource { + extendedLocation?: ExtendedLocation; + properties?: NetworkInterfaceProperties; +} + +// @public +export interface NetworkInterfaceArmReference { + id?: string; +} + +// @public +export interface NetworkInterfaceProperties { + createFromLocal?: boolean; + dnsSettings?: InterfaceDNSSettings; + ipConfigurations?: IPConfiguration[]; + macAddress?: string; + networkSecurityGroup?: NetworkSecurityGroupArmReference; + readonly provisioningState?: ProvisioningStateEnum; + readonly status?: NetworkInterfaceStatus; +} + +// @public +export interface NetworkInterfacesCreateOrUpdateOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface NetworkInterfacesDeleteOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface NetworkInterfacesGetOptionalParams extends OperationOptions { +} + +// @public +export interface NetworkInterfacesListAllOptionalParams extends OperationOptions { +} + +// @public +export interface NetworkInterfacesListByResourceGroupOptionalParams extends OperationOptions { +} + +// @public +export interface NetworkInterfacesOperations { + createOrUpdate: (resourceGroupName: string, networkInterfaceName: string, resource: NetworkInterface, options?: NetworkInterfacesCreateOrUpdateOptionalParams) => PollerLike, NetworkInterface>; + delete: (resourceGroupName: string, networkInterfaceName: string, options?: NetworkInterfacesDeleteOptionalParams) => PollerLike, void>; + get: (resourceGroupName: string, networkInterfaceName: string, options?: NetworkInterfacesGetOptionalParams) => Promise; + listAll: (options?: NetworkInterfacesListAllOptionalParams) => PagedAsyncIterableIterator; + listByResourceGroup: (resourceGroupName: string, options?: NetworkInterfacesListByResourceGroupOptionalParams) => PagedAsyncIterableIterator; + update: (resourceGroupName: string, networkInterfaceName: string, properties: NetworkInterfacesUpdateRequest, options?: NetworkInterfacesUpdateOptionalParams) => PollerLike, NetworkInterface>; +} + +// @public +export interface NetworkInterfaceStatus { + errorCode?: string; + errorMessage?: string; + provisioningStatus?: NetworkInterfaceStatusProvisioningStatus; +} + +// @public +export interface NetworkInterfaceStatusProvisioningStatus { + operationId?: string; + status?: Status; +} + +// @public +export interface NetworkInterfacesUpdateOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface NetworkInterfacesUpdateProperties { + dnsSettings?: InterfaceDNSSettings; + networkSecurityGroup?: NetworkSecurityGroupArmReference; +} + +// @public +export interface NetworkInterfacesUpdateRequest { + properties?: NetworkInterfacesUpdateProperties; + tags?: Record; +} + +// @public +export interface NetworkProfileUpdate { + networkInterfaces?: NetworkInterfaceArmReference[]; +} + +// @public +export interface NetworkSecurityGroup extends TrackedResource { + readonly eTag?: string; + extendedLocation?: ExtendedLocation; + properties?: NetworkSecurityGroupProperties; +} + +// @public +export interface NetworkSecurityGroupArmReference { + id?: string; +} + +// @public +export interface NetworkSecurityGroupProperties { + readonly networkInterfaces?: NetworkInterfaceArmReference[]; + readonly provisioningState?: ProvisioningStateEnum; + readonly status?: NetworkSecurityGroupStatus; + readonly subnets?: LogicalNetworkArmReference[]; +} + +// @public +export interface NetworkSecurityGroupsCreateOrUpdateOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface NetworkSecurityGroupsDeleteOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface NetworkSecurityGroupsGetOptionalParams extends OperationOptions { +} + +// @public +export interface NetworkSecurityGroupsListAllOptionalParams extends OperationOptions { +} + +// @public +export interface NetworkSecurityGroupsListByResourceGroupOptionalParams extends OperationOptions { +} + +// @public +export interface NetworkSecurityGroupsOperations { + createOrUpdate: (resourceGroupName: string, networkSecurityGroupName: string, resource: NetworkSecurityGroup, options?: NetworkSecurityGroupsCreateOrUpdateOptionalParams) => PollerLike, NetworkSecurityGroup>; + delete: (resourceGroupName: string, networkSecurityGroupName: string, options?: NetworkSecurityGroupsDeleteOptionalParams) => PollerLike, void>; + get: (resourceGroupName: string, networkSecurityGroupName: string, options?: NetworkSecurityGroupsGetOptionalParams) => Promise; + listAll: (options?: NetworkSecurityGroupsListAllOptionalParams) => PagedAsyncIterableIterator; + listByResourceGroup: (resourceGroupName: string, options?: NetworkSecurityGroupsListByResourceGroupOptionalParams) => PagedAsyncIterableIterator; + updateTags: (resourceGroupName: string, networkSecurityGroupName: string, properties: NetworkSecurityGroupTagsUpdate, options?: NetworkSecurityGroupsUpdateTagsOptionalParams) => PollerLike, NetworkSecurityGroup>; +} + +// @public +export interface NetworkSecurityGroupStatus { + errorCode?: string; + errorMessage?: string; + provisioningStatus?: NetworkSecurityGroupStatusProvisioningStatus; +} + +// @public +export interface NetworkSecurityGroupStatusProvisioningStatus { + operationId?: string; + status?: Status; +} + +// @public +export interface NetworkSecurityGroupsUpdateTagsOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface NetworkSecurityGroupTagsUpdate { + tags?: Record; +} + +// @public +export type OperatingSystemTypes = string; + +// @public +export interface OsProfileUpdate { + computerName?: string; + linuxConfiguration?: OsProfileUpdateLinuxConfiguration; + windowsConfiguration?: OsProfileUpdateWindowsConfiguration; +} + +// @public +export interface OsProfileUpdateLinuxConfiguration { + provisionVMAgent?: boolean; + provisionVMConfigAgent?: boolean; +} + +// @public +export interface OsProfileUpdateWindowsConfiguration { + provisionVMAgent?: boolean; + provisionVMConfigAgent?: boolean; +} + +// @public +export interface PagedAsyncIterableIterator { + [Symbol.asyncIterator](): PagedAsyncIterableIterator; + byPage: (settings?: TPageSettings) => AsyncIterableIterator>; + next(): Promise>; +} + +// @public +export interface PageSettings { + continuationToken?: string; +} + +// @public +export type PowerStateEnum = string; + +// @public +export type ProvisioningAction = string; + +// @public +export type ProvisioningStateEnum = string; + +// @public +export interface ProxyResource extends Resource { +} + +// @public +export interface Resource { + readonly id?: string; + readonly name?: string; + readonly systemData?: SystemData; + readonly type?: string; +} + +// @public +export function restorePoller(client: AzureStackHCIVMManagementClient, serializedState: string, sourceOperation: (...args: any[]) => PollerLike, TResult>, options?: RestorePollerOptions): PollerLike, TResult>; + +// @public (undocumented) +export interface RestorePollerOptions extends OperationOptions { + abortSignal?: AbortSignalLike; + processResponseBody?: (result: TResponse) => Promise; + updateIntervalInMs?: number; +} + +// @public +export interface Route { + name?: string; + properties?: RouteProperties; +} + +// @public +export interface RouteProperties { + addressPrefix?: string; + nextHopIpAddress?: string; +} + +// @public +export interface RouteTable { + readonly etag?: string; + readonly name?: string; + properties?: RouteTableProperties; + readonly type?: string; +} + +// @public +export interface RouteTableProperties { + routes?: Route[]; +} + +// @public +export type SecurityEncryptionType = string; + +// @public +export interface SecurityRule extends ProxyResource { + extendedLocation?: ExtendedLocation; + properties?: SecurityRuleProperties; +} + +// @public +export type SecurityRuleAccess = string; + +// @public +export type SecurityRuleDirection = string; + +// @public +export interface SecurityRuleProperties { + access: SecurityRuleAccess; + description?: string; + destinationAddressPrefixes?: string[]; + destinationPortRanges?: string[]; + direction: SecurityRuleDirection; + priority: number; + protocol: SecurityRuleProtocol; + readonly provisioningState?: ProvisioningStateEnum; + sourceAddressPrefixes?: string[]; + sourcePortRanges?: string[]; +} + +// @public +export type SecurityRuleProtocol = string; + +// @public +export interface SecurityRulesCreateOrUpdateOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface SecurityRulesDeleteOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface SecurityRulesGetOptionalParams extends OperationOptions { +} + +// @public +export interface SecurityRulesListByNetworkSecurityGroupOptionalParams extends OperationOptions { +} + +// @public +export interface SecurityRulesOperations { + createOrUpdate: (resourceGroupName: string, networkSecurityGroupName: string, securityRuleName: string, resource: SecurityRule, options?: SecurityRulesCreateOrUpdateOptionalParams) => PollerLike, SecurityRule>; + delete: (resourceGroupName: string, networkSecurityGroupName: string, securityRuleName: string, options?: SecurityRulesDeleteOptionalParams) => PollerLike, void>; + get: (resourceGroupName: string, networkSecurityGroupName: string, securityRuleName: string, options?: SecurityRulesGetOptionalParams) => Promise; + listByNetworkSecurityGroup: (resourceGroupName: string, networkSecurityGroupName: string, options?: SecurityRulesListByNetworkSecurityGroupOptionalParams) => PagedAsyncIterableIterator; +} + +// @public +export type SecurityTypes = string; + +// @public +export interface SshConfiguration { + publicKeys?: SshPublicKey[]; +} + +// @public +export interface SshPublicKey { + keyData?: string; + path?: string; +} + +// @public +export type Status = string; + +// @public +export type StatusLevelTypes = string; + +// @public +export type StatusTypes = string; + +// @public +export interface StorageContainer extends TrackedResource { + extendedLocation?: ExtendedLocation; + properties?: StorageContainerProperties; +} + +// @public +export interface StorageContainerProperties { + path: string; + readonly provisioningState?: ProvisioningStateEnum; + readonly status?: StorageContainerStatus; +} + +// @public +export interface StorageContainersCreateOrUpdateOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface StorageContainersDeleteOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface StorageContainersGetOptionalParams extends OperationOptions { +} + +// @public +export interface StorageContainersListAllOptionalParams extends OperationOptions { +} + +// @public +export interface StorageContainersListByResourceGroupOptionalParams extends OperationOptions { +} + +// @public +export interface StorageContainersOperations { + createOrUpdate: (resourceGroupName: string, storageContainerName: string, resource: StorageContainer, options?: StorageContainersCreateOrUpdateOptionalParams) => PollerLike, StorageContainer>; + delete: (resourceGroupName: string, storageContainerName: string, options?: StorageContainersDeleteOptionalParams) => PollerLike, void>; + get: (resourceGroupName: string, storageContainerName: string, options?: StorageContainersGetOptionalParams) => Promise; + listAll: (options?: StorageContainersListAllOptionalParams) => PagedAsyncIterableIterator; + listByResourceGroup: (resourceGroupName: string, options?: StorageContainersListByResourceGroupOptionalParams) => PagedAsyncIterableIterator; + update: (resourceGroupName: string, storageContainerName: string, properties: StorageContainerTagsUpdate, options?: StorageContainersUpdateOptionalParams) => PollerLike, StorageContainer>; +} + +// @public +export interface StorageContainerStatus { + availableSizeMB?: number; + containerSizeMB?: number; + errorCode?: string; + errorMessage?: string; + provisioningStatus?: StorageContainerStatusProvisioningStatus; +} + +// @public +export interface StorageContainerStatusProvisioningStatus { + operationId?: string; + status?: Status; +} + +// @public +export interface StorageContainersUpdateOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface StorageContainerTagsUpdate { + tags?: Record; +} + +// @public +export interface StorageProfileUpdate { + dataDisks?: VirtualHardDiskArmReference[]; +} + +// @public +export interface Subnet { + name?: string; + properties?: SubnetProperties; +} + +// @public +export interface SubnetIpConfigurationReference { + id?: string; +} + +// @public +export interface SubnetProperties { + addressPrefix?: string; + addressPrefixes?: string[]; + ipAllocationMethod?: IpAllocationMethodEnum; + ipConfigurationReferences?: SubnetIpConfigurationReference[]; + ipPools?: IPPool[]; + networkSecurityGroup?: NetworkSecurityGroupArmReference; + routeTable?: RouteTable; + vlan?: number; +} + +// @public +export interface SystemData { + createdAt?: Date; + createdBy?: string; + createdByType?: CreatedByType; + lastModifiedAt?: Date; + lastModifiedBy?: string; + lastModifiedByType?: CreatedByType; +} + +// @public +export interface TrackedResource extends Resource { + location: string; + tags?: Record; +} + +// @public +export interface UserAssignedIdentity { + readonly clientId?: string; + readonly principalId?: string; +} + +// @public +export interface VirtualHardDisk extends TrackedResource { + extendedLocation?: ExtendedLocation; + properties?: VirtualHardDiskProperties; +} + +// @public +export interface VirtualHardDiskArmReference { + id?: string; +} + +// @public +export interface VirtualHardDiskDownloadStatus { + downloadedSizeInMB?: number; + progressPercentage?: number; + status?: Status; +} + +// @public +export interface VirtualHardDiskProperties { + blockSizeBytes?: number; + containerId?: string; + createFromLocal?: boolean; + diskFileFormat?: DiskFileFormat; + diskSizeGB?: number; + downloadUrl?: string; + dynamic?: boolean; + hyperVGeneration?: HyperVGeneration; + logicalSectorBytes?: number; + maxShares?: number; + physicalSectorBytes?: number; + readonly provisioningState?: ProvisioningStateEnum; + readonly status?: VirtualHardDiskStatus; +} + +// @public +export interface VirtualHardDisksCreateOrUpdateOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface VirtualHardDisksDeleteOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface VirtualHardDisksGetOptionalParams extends OperationOptions { +} + +// @public +export interface VirtualHardDisksListAllOptionalParams extends OperationOptions { +} + +// @public +export interface VirtualHardDisksListByResourceGroupOptionalParams extends OperationOptions { +} + +// @public +export interface VirtualHardDisksOperations { + createOrUpdate: (resourceGroupName: string, virtualHardDiskName: string, resource: VirtualHardDisk, options?: VirtualHardDisksCreateOrUpdateOptionalParams) => PollerLike, VirtualHardDisk>; + delete: (resourceGroupName: string, virtualHardDiskName: string, options?: VirtualHardDisksDeleteOptionalParams) => PollerLike, void>; + get: (resourceGroupName: string, virtualHardDiskName: string, options?: VirtualHardDisksGetOptionalParams) => Promise; + listAll: (options?: VirtualHardDisksListAllOptionalParams) => PagedAsyncIterableIterator; + listByResourceGroup: (resourceGroupName: string, options?: VirtualHardDisksListByResourceGroupOptionalParams) => PagedAsyncIterableIterator; + update: (resourceGroupName: string, virtualHardDiskName: string, properties: VirtualHardDisksUpdateRequest, options?: VirtualHardDisksUpdateOptionalParams) => PollerLike, VirtualHardDisk>; + upload: (resourceGroupName: string, virtualHardDiskName: string, body: VirtualHardDiskUploadRequest, options?: VirtualHardDisksUploadOptionalParams) => PollerLike, VirtualHardDiskUploadResponse>; +} + +// @public +export interface VirtualHardDiskStatus { + downloadStatus?: VirtualHardDiskDownloadStatus; + errorCode?: string; + errorMessage?: string; + managedBy?: string[]; + provisioningStatus?: VirtualHardDiskStatusProvisioningStatus; + uniqueId?: string; + uploadStatus?: VirtualHardDiskUploadStatus; +} + +// @public +export interface VirtualHardDiskStatusProvisioningStatus { + operationId?: string; + status?: Status; +} + +// @public +export interface VirtualHardDisksUpdateOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface VirtualHardDisksUpdateProperties { + diskSizeGB?: number; +} + +// @public +export interface VirtualHardDisksUpdateRequest { + properties?: VirtualHardDisksUpdateProperties; + tags?: Record; +} + +// @public +export interface VirtualHardDisksUploadOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface VirtualHardDiskUploadRequest { + azureManagedDiskUploadUrl: string; +} + +// @public +export interface VirtualHardDiskUploadResponse { + uploadStatus?: VirtualHardDiskUploadStatus; + virtualHardDiskId?: string; +} + +// @public +export interface VirtualHardDiskUploadStatus { + errorCode?: string; + errorMessage?: string; + progressPercentage?: number; + status?: Status; + uploadedSizeInMB?: number; +} + +// @public +export interface VirtualMachineConfigAgentInstanceView { + statuses?: InstanceViewStatus[]; + vmConfigAgentVersion?: string; +} + +// @public +export interface VirtualMachineInstance extends ExtensionResource { + extendedLocation?: ExtendedLocation; + identity?: ManagedServiceIdentity; + properties?: VirtualMachineInstanceProperties; +} + +// @public +export interface VirtualMachineInstanceManagedDiskParameters { + securityProfile?: VMDiskSecurityProfile; +} + +// @public +export interface VirtualMachineInstanceProperties { + createFromLocal?: boolean; + guestAgentInstallStatus?: GuestAgentInstallStatus; + hardwareProfile?: VirtualMachineInstancePropertiesHardwareProfile; + readonly hostNodeIpAddress?: string; + readonly hostNodeName?: string; + httpProxyConfig?: HttpProxyConfiguration; + readonly hyperVVmId?: string; + readonly instanceView?: VirtualMachineInstanceView; + networkProfile?: VirtualMachineInstancePropertiesNetworkProfile; + osProfile?: VirtualMachineInstancePropertiesOsProfile; + placementProfile?: VirtualMachineInstancePropertiesPlacementProfile; + readonly provisioningState?: ProvisioningStateEnum; + resourceUid?: string; + securityProfile?: VirtualMachineInstancePropertiesSecurityProfile; + readonly status?: VirtualMachineInstanceStatus; + storageProfile?: VirtualMachineInstancePropertiesStorageProfile; + readonly vmId?: string; +} + +// @public +export interface VirtualMachineInstancePropertiesHardwareProfile { + dynamicMemoryConfig?: VirtualMachineInstancePropertiesHardwareProfileDynamicMemoryConfig; + memoryMB?: number; + processors?: number; + virtualMachineGPUs?: VirtualMachineInstancePropertiesHardwareProfileVirtualMachineGPU[]; + vmSize?: VmSizeEnum; +} + +// @public +export interface VirtualMachineInstancePropertiesHardwareProfileDynamicMemoryConfig { + maximumMemoryMB?: number; + minimumMemoryMB?: number; + targetMemoryBuffer?: number; +} + +// @public +export interface VirtualMachineInstancePropertiesHardwareProfileVirtualMachineGPU { + assignmentType: GpuAssignmentTypeEnum; + gpuName?: string; + partitionSizeMB?: number; +} + +// @public +export interface VirtualMachineInstancePropertiesNetworkProfile { + networkInterfaces?: NetworkInterfaceArmReference[]; +} + +// @public +export interface VirtualMachineInstancePropertiesOsProfile { + adminPassword?: string; + adminUsername?: string; + computerName?: string; + linuxConfiguration?: VirtualMachineInstancePropertiesOsProfileLinuxConfiguration; + windowsConfiguration?: VirtualMachineInstancePropertiesOsProfileWindowsConfiguration; +} + +// @public +export interface VirtualMachineInstancePropertiesOsProfileLinuxConfiguration { + disablePasswordAuthentication?: boolean; + provisionVMAgent?: boolean; + provisionVMConfigAgent?: boolean; + ssh?: SshConfiguration; +} + +// @public +export interface VirtualMachineInstancePropertiesOsProfileWindowsConfiguration { + enableAutomaticUpdates?: boolean; + provisionVMAgent?: boolean; + provisionVMConfigAgent?: boolean; + ssh?: SshConfiguration; + timeZone?: string; +} + +// @public +export interface VirtualMachineInstancePropertiesPlacementProfile { + strictPlacementPolicy?: boolean; + zone?: string; +} + +// @public +export interface VirtualMachineInstancePropertiesSecurityProfile { + enableTPM?: boolean; + securityType?: SecurityTypes; + uefiSettings?: VirtualMachineInstancePropertiesSecurityProfileUefiSettings; +} + +// @public +export interface VirtualMachineInstancePropertiesSecurityProfileUefiSettings { + secureBootEnabled?: boolean; +} + +// @public +export interface VirtualMachineInstancePropertiesStorageProfile { + dataDisks?: VirtualHardDiskArmReference[]; + imageReference?: ImageArmReference; + osDisk?: VirtualMachineInstancePropertiesStorageProfileOsDisk; + vmConfigStoragePathId?: string; +} + +// @public +export interface VirtualMachineInstancePropertiesStorageProfileOsDisk { + id?: string; + managedDisk?: VirtualMachineInstanceManagedDiskParameters; + osType?: OperatingSystemTypes; +} + +// @public +export interface VirtualMachineInstancesCreateOrUpdateOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface VirtualMachineInstancesDeleteOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface VirtualMachineInstancesGetOptionalParams extends OperationOptions { +} + +// @public +export interface VirtualMachineInstancesListOptionalParams extends OperationOptions { +} + +// @public +export interface VirtualMachineInstancesOperations { + createOrUpdate: (resourceUri: string, resource: VirtualMachineInstance, options?: VirtualMachineInstancesCreateOrUpdateOptionalParams) => PollerLike, VirtualMachineInstance>; + delete: (resourceUri: string, options?: VirtualMachineInstancesDeleteOptionalParams) => PollerLike, void>; + get: (resourceUri: string, options?: VirtualMachineInstancesGetOptionalParams) => Promise; + list: (resourceUri: string, options?: VirtualMachineInstancesListOptionalParams) => PagedAsyncIterableIterator; + pause: (resourceUri: string, options?: VirtualMachineInstancesPauseOptionalParams) => PollerLike, void>; + restart: (resourceUri: string, options?: VirtualMachineInstancesRestartOptionalParams) => PollerLike, void>; + save: (resourceUri: string, options?: VirtualMachineInstancesSaveOptionalParams) => PollerLike, void>; + start: (resourceUri: string, options?: VirtualMachineInstancesStartOptionalParams) => PollerLike, void>; + stop: (resourceUri: string, options?: VirtualMachineInstancesStopOptionalParams) => PollerLike, void>; + update: (resourceUri: string, properties: VirtualMachineInstanceUpdateRequest, options?: VirtualMachineInstancesUpdateOptionalParams) => PollerLike, VirtualMachineInstance>; +} + +// @public +export interface VirtualMachineInstancesPauseOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface VirtualMachineInstancesRestartOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface VirtualMachineInstancesSaveOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface VirtualMachineInstancesStartOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface VirtualMachineInstancesStopOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface VirtualMachineInstanceStatus { + errorCode?: string; + errorMessage?: string; + powerState?: PowerStateEnum; + provisioningStatus?: VirtualMachineInstanceStatusProvisioningStatus; +} + +// @public +export interface VirtualMachineInstanceStatusProvisioningStatus { + operationId?: string; + status?: Status; +} + +// @public +export interface VirtualMachineInstancesUpdateOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface VirtualMachineInstanceUpdateProperties { + hardwareProfile?: HardwareProfileUpdate; + networkProfile?: NetworkProfileUpdate; + osProfile?: OsProfileUpdate; + storageProfile?: StorageProfileUpdate; +} + +// @public +export interface VirtualMachineInstanceUpdateRequest { + identity?: Identity; + properties?: VirtualMachineInstanceUpdateProperties; +} + +// @public +export interface VirtualMachineInstanceView { + vmAgent?: VirtualMachineConfigAgentInstanceView; +} + +// @public +export interface VMDiskSecurityProfile { + securityEncryptionType?: SecurityEncryptionType; +} + +// @public +export interface VmImageRepositoryCredentials { + password: string; + username: string; +} + +// @public +export type VmSizeEnum = string; + +// (No @packageDocumentation comment for this package) + +``` diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/sample.env b/sdk/azurestackhcivm/arm-azurestackhcivm/sample.env new file mode 100644 index 000000000000..508439fc7d62 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/sample.env @@ -0,0 +1 @@ +# Feel free to add your own environment variables. \ No newline at end of file diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/attestationStatusesGetSample.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/attestationStatusesGetSample.ts new file mode 100644 index 000000000000..9e79868a0d86 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/attestationStatusesGetSample.ts @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { AzureStackHCIVMManagementClient } from "@azure/arm-azurestackhcivm"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to implements AttestationStatus GET method. + * + * @summary implements AttestationStatus GET method. + * x-ms-original-file: 2025-06-01-preview/AttestationStatuses_Get.json + */ +async function getAttestationStatus(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-00000000000"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + const result = await client.attestationStatuses.get( + "subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.HybridCompute/machines/DemoVM", + ); + console.log(result); +} + +async function main(): Promise { + await getAttestationStatus(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/galleryImagesCreateOrUpdateSample.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/galleryImagesCreateOrUpdateSample.ts new file mode 100644 index 000000000000..edbb8c498ff1 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/galleryImagesCreateOrUpdateSample.ts @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { AzureStackHCIVMManagementClient } from "@azure/arm-azurestackhcivm"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to the operation to create or update a gallery image. Please note some properties can be set only during gallery image creation. + * + * @summary the operation to create or update a gallery image. Please note some properties can be set only during gallery image creation. + * x-ms-original-file: 2025-06-01-preview/GalleryImages_CreateOrUpdate.json + */ +async function putGalleryImage(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + const result = await client.galleryImages.createOrUpdate("test-rg", "test-gallery-image", { + extendedLocation: { + name: "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location", + type: "CustomLocation", + }, + location: "West US2", + properties: { + containerId: + "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/storageContainers/test-storage-container", + imagePath: "C:\\test.vhdx", + osType: "Linux", + }, + }); + console.log(result); +} + +async function main(): Promise { + await putGalleryImage(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/galleryImagesDeleteSample.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/galleryImagesDeleteSample.ts new file mode 100644 index 000000000000..037b1603a569 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/galleryImagesDeleteSample.ts @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { AzureStackHCIVMManagementClient } from "@azure/arm-azurestackhcivm"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to the operation to delete a gallery image. + * + * @summary the operation to delete a gallery image. + * x-ms-original-file: 2025-06-01-preview/GalleryImages_Delete.json + */ +async function deleteGalleryImage(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + await client.galleryImages.delete("test-rg", "test-gallery-image"); +} + +async function main(): Promise { + await deleteGalleryImage(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/galleryImagesGetSample.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/galleryImagesGetSample.ts new file mode 100644 index 000000000000..a0280555db92 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/galleryImagesGetSample.ts @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { AzureStackHCIVMManagementClient } from "@azure/arm-azurestackhcivm"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to gets a gallery image + * + * @summary gets a gallery image + * x-ms-original-file: 2025-06-01-preview/GalleryImages_Get.json + */ +async function getGalleryImage(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + const result = await client.galleryImages.get("test-rg", "test-gallery-image"); + console.log(result); +} + +async function main(): Promise { + await getGalleryImage(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/galleryImagesListAllSample.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/galleryImagesListAllSample.ts new file mode 100644 index 000000000000..2cc5ffaab1e2 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/galleryImagesListAllSample.ts @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { AzureStackHCIVMManagementClient } from "@azure/arm-azurestackhcivm"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to lists all of the gallery images in the specified subscription. Use the nextLink property in the response to get the next page of gallery images. + * + * @summary lists all of the gallery images in the specified subscription. Use the nextLink property in the response to get the next page of gallery images. + * x-ms-original-file: 2025-06-01-preview/GalleryImages_ListAll.json + */ +async function listGalleryImageBySubscription(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.galleryImages.listAll()) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main(): Promise { + await listGalleryImageBySubscription(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/galleryImagesListByResourceGroupSample.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/galleryImagesListByResourceGroupSample.ts new file mode 100644 index 000000000000..6039828aa2b1 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/galleryImagesListByResourceGroupSample.ts @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { AzureStackHCIVMManagementClient } from "@azure/arm-azurestackhcivm"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to lists all of the gallery images in the specified resource group. Use the nextLink property in the response to get the next page of gallery images. + * + * @summary lists all of the gallery images in the specified resource group. Use the nextLink property in the response to get the next page of gallery images. + * x-ms-original-file: 2025-06-01-preview/GalleryImages_ListByResourceGroup.json + */ +async function listGalleryImageByResourceGroup(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.galleryImages.listByResourceGroup("test-rg")) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main(): Promise { + await listGalleryImageByResourceGroup(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/galleryImagesUpdateSample.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/galleryImagesUpdateSample.ts new file mode 100644 index 000000000000..2a1eef214d51 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/galleryImagesUpdateSample.ts @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { AzureStackHCIVMManagementClient } from "@azure/arm-azurestackhcivm"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to the operation to update a gallery image. + * + * @summary the operation to update a gallery image. + * x-ms-original-file: 2025-06-01-preview/GalleryImages_Update.json + */ +async function updateGalleryImage(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + const result = await client.galleryImages.update("test-rg", "test-gallery-image", { + tags: { additionalProperties: "sample" }, + }); + console.log(result); +} + +async function main(): Promise { + await updateGalleryImage(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/guestAgentsCreateSample.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/guestAgentsCreateSample.ts new file mode 100644 index 000000000000..2e0a46f67c41 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/guestAgentsCreateSample.ts @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { AzureStackHCIVMManagementClient } from "@azure/arm-azurestackhcivm"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to create Or Update GuestAgent. + * + * @summary create Or Update GuestAgent. + * x-ms-original-file: 2025-06-01-preview/GuestAgents_Create.json + */ +async function createGuestAgent(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-00000000000"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + const result = await client.guestAgents.create( + "subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.HybridCompute/machines/DemoVM", + { + properties: { + credentials: { password: "", username: "tempuser" }, + provisioningAction: "install", + }, + }, + ); + console.log(result); +} + +async function main(): Promise { + await createGuestAgent(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/guestAgentsDeleteSample.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/guestAgentsDeleteSample.ts new file mode 100644 index 000000000000..3b96d8ab87ca --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/guestAgentsDeleteSample.ts @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { AzureStackHCIVMManagementClient } from "@azure/arm-azurestackhcivm"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to implements GuestAgent DELETE method. + * + * @summary implements GuestAgent DELETE method. + * x-ms-original-file: 2025-06-01-preview/GuestAgents_Delete.json + */ +async function deleteGuestAgent(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-00000000000"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + await client.guestAgents.delete( + "subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.HybridCompute/machines/DemoVM", + ); +} + +async function main(): Promise { + await deleteGuestAgent(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/guestAgentsGetSample.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/guestAgentsGetSample.ts new file mode 100644 index 000000000000..693cd3739ddb --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/guestAgentsGetSample.ts @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { AzureStackHCIVMManagementClient } from "@azure/arm-azurestackhcivm"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to implements GuestAgent GET method. + * + * @summary implements GuestAgent GET method. + * x-ms-original-file: 2025-06-01-preview/GuestAgents_Get.json + */ +async function getGuestAgent(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-00000000000"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + const result = await client.guestAgents.get( + "subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.HybridCompute/machines/DemoVM", + ); + console.log(result); +} + +async function main(): Promise { + await getGuestAgent(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/guestAgentsListByVirtualMachineInstanceSample.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/guestAgentsListByVirtualMachineInstanceSample.ts new file mode 100644 index 000000000000..5104f15cb01f --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/guestAgentsListByVirtualMachineInstanceSample.ts @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { AzureStackHCIVMManagementClient } from "@azure/arm-azurestackhcivm"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to returns the list of GuestAgent of the given vm. + * + * @summary returns the list of GuestAgent of the given vm. + * x-ms-original-file: 2025-06-01-preview/GuestAgents_ListByVirtualMachineInstance.json + */ +async function guestAgentListByVirtualMachineInstances(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-00000000000"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.guestAgents.listByVirtualMachineInstance( + "subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.HybridCompute/machines/DemoVM", + )) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main(): Promise { + await guestAgentListByVirtualMachineInstances(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/hybridIdentityMetadataGetSample.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/hybridIdentityMetadataGetSample.ts new file mode 100644 index 000000000000..95355925d60f --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/hybridIdentityMetadataGetSample.ts @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { AzureStackHCIVMManagementClient } from "@azure/arm-azurestackhcivm"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to implements HybridIdentityMetadata GET method. + * + * @summary implements HybridIdentityMetadata GET method. + * x-ms-original-file: 2025-06-01-preview/HybridIdentityMetadataGroup_Get.json + */ +async function getHybridIdentityMetadata(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-00000000000"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + const result = await client.hybridIdentityMetadata.get( + "subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.HybridCompute/machines/DemoVM", + ); + console.log(result); +} + +async function main(): Promise { + await getHybridIdentityMetadata(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/hybridIdentityMetadataListByVirtualMachineInstanceSample.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/hybridIdentityMetadataListByVirtualMachineInstanceSample.ts new file mode 100644 index 000000000000..5d586560d292 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/hybridIdentityMetadataListByVirtualMachineInstanceSample.ts @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { AzureStackHCIVMManagementClient } from "@azure/arm-azurestackhcivm"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to returns the list of HybridIdentityMetadata of the given vm. + * + * @summary returns the list of HybridIdentityMetadata of the given vm. + * x-ms-original-file: 2025-06-01-preview/HybridIdentityMetadata_ListByVirtualMachineInstance.json + */ +async function hybridIdentityMetadataListByVirtualMachineInstances(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-00000000000"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.hybridIdentityMetadata.listByVirtualMachineInstance( + "subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.HybridCompute/machines/DemoVM", + )) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main(): Promise { + await hybridIdentityMetadataListByVirtualMachineInstances(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/logicalNetworksCreateOrUpdateSample.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/logicalNetworksCreateOrUpdateSample.ts new file mode 100644 index 000000000000..f987bef7fda3 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/logicalNetworksCreateOrUpdateSample.ts @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { AzureStackHCIVMManagementClient } from "@azure/arm-azurestackhcivm"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to the operation to create or update a logical network. Please note some properties can be set only during logical network creation. + * + * @summary the operation to create or update a logical network. Please note some properties can be set only during logical network creation. + * x-ms-original-file: 2025-06-01-preview/LogicalNetworks_CreateOrUpdate.json + */ +async function putLogicalNetwork(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + const result = await client.logicalNetworks.createOrUpdate("test-rg", "test-lnet", { + extendedLocation: { + name: "/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location", + type: "CustomLocation", + }, + location: "West US2", + }); + console.log(result); +} + +async function main(): Promise { + await putLogicalNetwork(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/logicalNetworksDeleteSample.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/logicalNetworksDeleteSample.ts new file mode 100644 index 000000000000..c4543d3823f4 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/logicalNetworksDeleteSample.ts @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { AzureStackHCIVMManagementClient } from "@azure/arm-azurestackhcivm"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to the operation to delete a logical network. + * + * @summary the operation to delete a logical network. + * x-ms-original-file: 2025-06-01-preview/LogicalNetworks_Delete.json + */ +async function deleteLogicalNetwork(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + await client.logicalNetworks.delete("test-rg", "test-lnet"); +} + +async function main(): Promise { + await deleteLogicalNetwork(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/logicalNetworksGetSample.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/logicalNetworksGetSample.ts new file mode 100644 index 000000000000..ed5ff8bc7133 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/logicalNetworksGetSample.ts @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { AzureStackHCIVMManagementClient } from "@azure/arm-azurestackhcivm"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to the operation to get a logical network. + * + * @summary the operation to get a logical network. + * x-ms-original-file: 2025-06-01-preview/LogicalNetworks_Get.json + */ +async function getLogicalNetwork(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + const result = await client.logicalNetworks.get("test-rg", "test-lnet"); + console.log(result); +} + +async function main(): Promise { + await getLogicalNetwork(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/logicalNetworksListAllSample.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/logicalNetworksListAllSample.ts new file mode 100644 index 000000000000..c11774f38ed1 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/logicalNetworksListAllSample.ts @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { AzureStackHCIVMManagementClient } from "@azure/arm-azurestackhcivm"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to lists all of the logical networks in the specified subscription. Use the nextLink property in the response to get the next page of logical networks. + * + * @summary lists all of the logical networks in the specified subscription. Use the nextLink property in the response to get the next page of logical networks. + * x-ms-original-file: 2025-06-01-preview/LogicalNetworks_ListAll.json + */ +async function listLogicalNetworkBySubscription(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.logicalNetworks.listAll()) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main(): Promise { + await listLogicalNetworkBySubscription(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/logicalNetworksListByResourceGroupSample.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/logicalNetworksListByResourceGroupSample.ts new file mode 100644 index 000000000000..abd2baac2cd8 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/logicalNetworksListByResourceGroupSample.ts @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { AzureStackHCIVMManagementClient } from "@azure/arm-azurestackhcivm"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to lists all of the logical networks in the specified resource group. Use the nextLink property in the response to get the next page of logical networks. + * + * @summary lists all of the logical networks in the specified resource group. Use the nextLink property in the response to get the next page of logical networks. + * x-ms-original-file: 2025-06-01-preview/LogicalNetworks_ListByResourceGroup.json + */ +async function listLogicalNetworkByResourceGroup(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.logicalNetworks.listByResourceGroup("test-rg")) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main(): Promise { + await listLogicalNetworkByResourceGroup(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/logicalNetworksUpdateSample.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/logicalNetworksUpdateSample.ts new file mode 100644 index 000000000000..19787d45c876 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/logicalNetworksUpdateSample.ts @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { AzureStackHCIVMManagementClient } from "@azure/arm-azurestackhcivm"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to the operation to update a logical network. + * + * @summary the operation to update a logical network. + * x-ms-original-file: 2025-06-01-preview/LogicalNetworks_Update.json + */ +async function updateLogicalNetwork(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + const result = await client.logicalNetworks.update("test-rg", "test-lnet", { + tags: { additionalProperties: "sample" }, + }); + console.log(result); +} + +async function main(): Promise { + await updateLogicalNetwork(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/marketplaceGalleryImagesCreateOrUpdateSample.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/marketplaceGalleryImagesCreateOrUpdateSample.ts new file mode 100644 index 000000000000..b81645279528 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/marketplaceGalleryImagesCreateOrUpdateSample.ts @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { AzureStackHCIVMManagementClient } from "@azure/arm-azurestackhcivm"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to the operation to create or update a marketplace gallery image. Please note some properties can be set only during marketplace gallery image creation. + * + * @summary the operation to create or update a marketplace gallery image. Please note some properties can be set only during marketplace gallery image creation. + * x-ms-original-file: 2025-06-01-preview/MarketplaceGalleryImages_CreateOrUpdate.json + */ +async function putMarketplaceGalleryImage(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + const result = await client.marketplaceGalleryImages.createOrUpdate( + "test-rg", + "test-marketplace-gallery-image", + { + extendedLocation: { + name: "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location", + type: "CustomLocation", + }, + location: "West US2", + properties: { + cloudInitDataSource: "Azure", + containerId: + "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/storageContainers/test-storage-container", + hyperVGeneration: "V1", + identifier: { + offer: "myOfferName", + publisher: "myPublisherName", + sku: "mySkuName", + }, + osType: "Windows", + version: { name: "1.0.0" }, + }, + }, + ); + console.log(result); +} + +async function main(): Promise { + await putMarketplaceGalleryImage(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/marketplaceGalleryImagesDeleteSample.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/marketplaceGalleryImagesDeleteSample.ts new file mode 100644 index 000000000000..02c67f21e906 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/marketplaceGalleryImagesDeleteSample.ts @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { AzureStackHCIVMManagementClient } from "@azure/arm-azurestackhcivm"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to the operation to delete a marketplace gallery image. + * + * @summary the operation to delete a marketplace gallery image. + * x-ms-original-file: 2025-06-01-preview/MarketplaceGalleryImages_Delete.json + */ +async function deleteMarketplaceGalleryImage(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + await client.marketplaceGalleryImages.delete("test-rg", "test-marketplace-gallery-image"); +} + +async function main(): Promise { + await deleteMarketplaceGalleryImage(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/marketplaceGalleryImagesGetSample.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/marketplaceGalleryImagesGetSample.ts new file mode 100644 index 000000000000..89d0be01ba8a --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/marketplaceGalleryImagesGetSample.ts @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { AzureStackHCIVMManagementClient } from "@azure/arm-azurestackhcivm"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to gets a marketplace gallery image + * + * @summary gets a marketplace gallery image + * x-ms-original-file: 2025-06-01-preview/MarketplaceGalleryImages_Get.json + */ +async function getMarketplaceGalleryImage(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + const result = await client.marketplaceGalleryImages.get( + "test-rg", + "test-marketplace-gallery-image", + ); + console.log(result); +} + +async function main(): Promise { + await getMarketplaceGalleryImage(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/marketplaceGalleryImagesListAllSample.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/marketplaceGalleryImagesListAllSample.ts new file mode 100644 index 000000000000..b0bad99c288f --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/marketplaceGalleryImagesListAllSample.ts @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { AzureStackHCIVMManagementClient } from "@azure/arm-azurestackhcivm"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to lists all of the marketplace gallery images in the specified subscription. Use the nextLink property in the response to get the next page of marketplace gallery images. + * + * @summary lists all of the marketplace gallery images in the specified subscription. Use the nextLink property in the response to get the next page of marketplace gallery images. + * x-ms-original-file: 2025-06-01-preview/MarketplaceGalleryImages_ListAll.json + */ +async function listMarketplaceGalleryImageBySubscription(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.marketplaceGalleryImages.listAll()) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main(): Promise { + await listMarketplaceGalleryImageBySubscription(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/marketplaceGalleryImagesListByResourceGroupSample.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/marketplaceGalleryImagesListByResourceGroupSample.ts new file mode 100644 index 000000000000..cd3485949cae --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/marketplaceGalleryImagesListByResourceGroupSample.ts @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { AzureStackHCIVMManagementClient } from "@azure/arm-azurestackhcivm"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to lists all of the marketplace gallery images in the specified resource group. Use the nextLink property in the response to get the next page of marketplace gallery images. + * + * @summary lists all of the marketplace gallery images in the specified resource group. Use the nextLink property in the response to get the next page of marketplace gallery images. + * x-ms-original-file: 2025-06-01-preview/MarketplaceGalleryImages_ListByResourceGroup.json + */ +async function listMarketplaceGalleryImageByResourceGroup(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.marketplaceGalleryImages.listByResourceGroup("test-rg")) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main(): Promise { + await listMarketplaceGalleryImageByResourceGroup(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/marketplaceGalleryImagesUpdateSample.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/marketplaceGalleryImagesUpdateSample.ts new file mode 100644 index 000000000000..ebaf2238f316 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/marketplaceGalleryImagesUpdateSample.ts @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { AzureStackHCIVMManagementClient } from "@azure/arm-azurestackhcivm"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to the operation to update a marketplace gallery image. + * + * @summary the operation to update a marketplace gallery image. + * x-ms-original-file: 2025-06-01-preview/MarketplaceGalleryImages_Update.json + */ +async function updateMarketplaceGalleryImage(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + const result = await client.marketplaceGalleryImages.update( + "test-rg", + "test-marketplce-gallery-image", + { tags: { additionalProperties: "sample" } }, + ); + console.log(result); +} + +async function main(): Promise { + await updateMarketplaceGalleryImage(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/networkInterfacesCreateOrUpdateSample.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/networkInterfacesCreateOrUpdateSample.ts new file mode 100644 index 000000000000..554e3f6e498d --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/networkInterfacesCreateOrUpdateSample.ts @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { AzureStackHCIVMManagementClient } from "@azure/arm-azurestackhcivm"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to the operation to create or update a network interface. Please note some properties can be set only during network interface creation. + * + * @summary the operation to create or update a network interface. Please note some properties can be set only during network interface creation. + * x-ms-original-file: 2025-06-01-preview/NetworkInterfaces_CreateOrUpdate.json + */ +async function putNetworkInterface(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + const result = await client.networkInterfaces.createOrUpdate("test-rg", "test-nic", { + extendedLocation: { + name: "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location", + type: "CustomLocation", + }, + location: "eastus", + properties: { + ipConfigurations: [ + { + name: "ipconfig-sample", + properties: { + subnet: { + id: "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/logicalNetworks/test-lnet", + }, + }, + }, + ], + }, + }); + console.log(result); +} + +/** + * This sample demonstrates how to the operation to create or update a network interface. Please note some properties can be set only during network interface creation. + * + * @summary the operation to create or update a network interface. Please note some properties can be set only during network interface creation. + * x-ms-original-file: 2025-06-01-preview/NetworkInterfaces__CreateOrUpdate_CreateFromLocal.json + */ +async function createNetworkInterfaceFromLocal(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + const result = await client.networkInterfaces.createOrUpdate("test-rg", "test-nic", { + extendedLocation: { + name: "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location", + type: "CustomLocation", + }, + location: "eastus", + properties: { + ipConfigurations: [ + { + name: "ipconfig-sample", + properties: { + subnet: { + id: "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/logicalNetworks/test-lnet", + }, + }, + }, + ], + createFromLocal: true, + }, + }); + console.log(result); +} + +async function main(): Promise { + await putNetworkInterface(); + await createNetworkInterfaceFromLocal(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/networkInterfacesDeleteSample.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/networkInterfacesDeleteSample.ts new file mode 100644 index 000000000000..13a757a9ed6d --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/networkInterfacesDeleteSample.ts @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { AzureStackHCIVMManagementClient } from "@azure/arm-azurestackhcivm"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to the operation to delete a network interface. + * + * @summary the operation to delete a network interface. + * x-ms-original-file: 2025-06-01-preview/NetworkInterfaces_Delete.json + */ +async function deleteNetworkInterface(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + await client.networkInterfaces.delete("test-rg", "test-nic"); +} + +async function main(): Promise { + await deleteNetworkInterface(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/networkInterfacesGetSample.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/networkInterfacesGetSample.ts new file mode 100644 index 000000000000..e3769ce505b3 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/networkInterfacesGetSample.ts @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { AzureStackHCIVMManagementClient } from "@azure/arm-azurestackhcivm"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to gets a network interface + * + * @summary gets a network interface + * x-ms-original-file: 2025-06-01-preview/NetworkInterfaces_Get.json + */ +async function getNetworkInterface(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + const result = await client.networkInterfaces.get("test-rg", "test-nic"); + console.log(result); +} + +async function main(): Promise { + await getNetworkInterface(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/networkInterfacesListAllSample.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/networkInterfacesListAllSample.ts new file mode 100644 index 000000000000..513ee7aac960 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/networkInterfacesListAllSample.ts @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { AzureStackHCIVMManagementClient } from "@azure/arm-azurestackhcivm"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to lists all of the network interfaces in the specified subscription. Use the nextLink property in the response to get the next page of network interfaces. + * + * @summary lists all of the network interfaces in the specified subscription. Use the nextLink property in the response to get the next page of network interfaces. + * x-ms-original-file: 2025-06-01-preview/NetworkInterfaces_ListAll.json + */ +async function listNetworkInterfaceBySubscription(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.networkInterfaces.listAll()) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main(): Promise { + await listNetworkInterfaceBySubscription(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/networkInterfacesListByResourceGroupSample.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/networkInterfacesListByResourceGroupSample.ts new file mode 100644 index 000000000000..13cba8ffa827 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/networkInterfacesListByResourceGroupSample.ts @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { AzureStackHCIVMManagementClient } from "@azure/arm-azurestackhcivm"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to lists all of the network interfaces in the specified resource group. Use the nextLink property in the response to get the next page of network interfaces. + * + * @summary lists all of the network interfaces in the specified resource group. Use the nextLink property in the response to get the next page of network interfaces. + * x-ms-original-file: 2025-06-01-preview/NetworkInterfaces_ListByResourceGroup.json + */ +async function listNetworkInterfaceByResourceGroup(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.networkInterfaces.listByResourceGroup("test-rg")) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main(): Promise { + await listNetworkInterfaceByResourceGroup(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/networkInterfacesUpdateSample.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/networkInterfacesUpdateSample.ts new file mode 100644 index 000000000000..98a0b719526c --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/networkInterfacesUpdateSample.ts @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { AzureStackHCIVMManagementClient } from "@azure/arm-azurestackhcivm"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to the operation to update a network interface. + * + * @summary the operation to update a network interface. + * x-ms-original-file: 2025-06-01-preview/NetworkInterfaces_Update.json + */ +async function updateNetworkInterface(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + const result = await client.networkInterfaces.update("test-rg", "test-nic", { + tags: { additionalProperties: "sample" }, + }); + console.log(result); +} + +async function main(): Promise { + await updateNetworkInterface(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/networkSecurityGroupsCreateOrUpdateSample.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/networkSecurityGroupsCreateOrUpdateSample.ts new file mode 100644 index 000000000000..af9c1ac97daa --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/networkSecurityGroupsCreateOrUpdateSample.ts @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { AzureStackHCIVMManagementClient } from "@azure/arm-azurestackhcivm"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to creates or updates a network security group in the specified resource group. + * + * @summary creates or updates a network security group in the specified resource group. + * x-ms-original-file: 2025-06-01-preview/NetworkSecurityGroups_CreateOrUpdate.json + */ +async function createNetworkSecurityGroup(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + const result = await client.networkSecurityGroups.createOrUpdate("testrg", "testnsg", { + location: "eastus", + }); + console.log(result); +} + +async function main(): Promise { + await createNetworkSecurityGroup(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/networkSecurityGroupsDeleteSample.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/networkSecurityGroupsDeleteSample.ts new file mode 100644 index 000000000000..99720f76bb07 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/networkSecurityGroupsDeleteSample.ts @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { AzureStackHCIVMManagementClient } from "@azure/arm-azurestackhcivm"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to deletes the specified network security group. + * + * @summary deletes the specified network security group. + * x-ms-original-file: 2025-06-01-preview/NetworkSecurityGroups_Delete.json + */ +async function deleteNetworkSecurityGroup(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + await client.networkSecurityGroups.delete("test-rg", "testnsg"); +} + +async function main(): Promise { + await deleteNetworkSecurityGroup(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/networkSecurityGroupsGetSample.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/networkSecurityGroupsGetSample.ts new file mode 100644 index 000000000000..37854ae8447b --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/networkSecurityGroupsGetSample.ts @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { AzureStackHCIVMManagementClient } from "@azure/arm-azurestackhcivm"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to gets the specified network security group. + * + * @summary gets the specified network security group. + * x-ms-original-file: 2025-06-01-preview/NetworkSecurityGroups_Get.json + */ +async function getNetworkSecurityGroup(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + const result = await client.networkSecurityGroups.get("test-rg", "testnsg"); + console.log(result); +} + +async function main(): Promise { + await getNetworkSecurityGroup(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/networkSecurityGroupsListAllSample.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/networkSecurityGroupsListAllSample.ts new file mode 100644 index 000000000000..9b33a2c00f8c --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/networkSecurityGroupsListAllSample.ts @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { AzureStackHCIVMManagementClient } from "@azure/arm-azurestackhcivm"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to gets all network security groups in a subscription. + * + * @summary gets all network security groups in a subscription. + * x-ms-original-file: 2025-06-01-preview/NetworkSecurityGroups_ListAll.json + */ +async function listAllNetworkSecurityGroups(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.networkSecurityGroups.listAll()) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main(): Promise { + await listAllNetworkSecurityGroups(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/networkSecurityGroupsListByResourceGroupSample.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/networkSecurityGroupsListByResourceGroupSample.ts new file mode 100644 index 000000000000..bf52dd26218b --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/networkSecurityGroupsListByResourceGroupSample.ts @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { AzureStackHCIVMManagementClient } from "@azure/arm-azurestackhcivm"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to gets all network security groups in a resource group. + * + * @summary gets all network security groups in a resource group. + * x-ms-original-file: 2025-06-01-preview/NetworkSecurityGroups_ListByResourceGroup.json + */ +async function listNetworkSecurityGroupsInResourceGroup(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.networkSecurityGroups.listByResourceGroup("testrg")) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main(): Promise { + await listNetworkSecurityGroupsInResourceGroup(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/networkSecurityGroupsUpdateTagsSample.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/networkSecurityGroupsUpdateTagsSample.ts new file mode 100644 index 000000000000..3512a393380f --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/networkSecurityGroupsUpdateTagsSample.ts @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { AzureStackHCIVMManagementClient } from "@azure/arm-azurestackhcivm"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to updates a network security group tags. + * + * @summary updates a network security group tags. + * x-ms-original-file: 2025-06-01-preview/NetworkSecurityGroups_UpdateTags.json + */ +async function updateNetworkSecurityGroupTags(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + const result = await client.networkSecurityGroups.updateTags("testrg", "testnsg", { + tags: { tag1: "value1", tag2: "value2" }, + }); + console.log(result); +} + +async function main(): Promise { + await updateNetworkSecurityGroupTags(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/securityRulesCreateOrUpdateSample.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/securityRulesCreateOrUpdateSample.ts new file mode 100644 index 000000000000..f2730f3c1eff --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/securityRulesCreateOrUpdateSample.ts @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { AzureStackHCIVMManagementClient } from "@azure/arm-azurestackhcivm"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to creates or updates a security rule in the specified resource group. + * + * @summary creates or updates a security rule in the specified resource group. + * x-ms-original-file: 2025-06-01-preview/SecurityRules_CreateOrUpdate.json + */ +async function securityRulesCreateOrUpdate(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + const result = await client.securityRules.createOrUpdate("testrg", "testnsg", "rule1", { + extendedLocation: { + name: "/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location", + type: "CustomLocation", + }, + properties: { + access: "Allow", + destinationAddressPrefixes: ["*"], + destinationPortRanges: ["80"], + direction: "Inbound", + priority: 130, + sourceAddressPrefixes: ["*"], + sourcePortRanges: ["*"], + protocol: "*", + }, + }); + console.log(result); +} + +async function main(): Promise { + await securityRulesCreateOrUpdate(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/securityRulesDeleteSample.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/securityRulesDeleteSample.ts new file mode 100644 index 000000000000..99af3a094c69 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/securityRulesDeleteSample.ts @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { AzureStackHCIVMManagementClient } from "@azure/arm-azurestackhcivm"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to deletes the specified security rule. + * + * @summary deletes the specified security rule. + * x-ms-original-file: 2025-06-01-preview/SecurityRules_Delete.json + */ +async function securityRulesDelete(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + await client.securityRules.delete("testrg", "testnsg", "rule1"); +} + +async function main(): Promise { + await securityRulesDelete(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/securityRulesGetSample.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/securityRulesGetSample.ts new file mode 100644 index 000000000000..0b742b5be8a4 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/securityRulesGetSample.ts @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { AzureStackHCIVMManagementClient } from "@azure/arm-azurestackhcivm"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to gets the specified security rule. + * + * @summary gets the specified security rule. + * x-ms-original-file: 2025-06-01-preview/SecurityRules_Get.json + */ +async function getNetworkSecurityRuleInNetworkSecurityGroup(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + const result = await client.securityRules.get("testrg", "testnsg", "rule1"); + console.log(result); +} + +async function main(): Promise { + await getNetworkSecurityRuleInNetworkSecurityGroup(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/securityRulesListByNetworkSecurityGroupSample.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/securityRulesListByNetworkSecurityGroupSample.ts new file mode 100644 index 000000000000..d1001c9b7441 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/securityRulesListByNetworkSecurityGroupSample.ts @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { AzureStackHCIVMManagementClient } from "@azure/arm-azurestackhcivm"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to gets all security rules in a Network Security Group. + * + * @summary gets all security rules in a Network Security Group. + * x-ms-original-file: 2025-06-01-preview/SecurityRules_ListByNetworkSecurityGroup.json + */ +async function listNetworkSecurityRulesInNetworkSecurityGroup(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.securityRules.listByNetworkSecurityGroup("testrg", "testnsg")) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main(): Promise { + await listNetworkSecurityRulesInNetworkSecurityGroup(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/storageContainersCreateOrUpdateSample.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/storageContainersCreateOrUpdateSample.ts new file mode 100644 index 000000000000..d8d1214e6a8e --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/storageContainersCreateOrUpdateSample.ts @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { AzureStackHCIVMManagementClient } from "@azure/arm-azurestackhcivm"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to the operation to create or update a storage container. Please note some properties can be set only during storage container creation. + * + * @summary the operation to create or update a storage container. Please note some properties can be set only during storage container creation. + * x-ms-original-file: 2025-06-01-preview/StorageContainers_CreateOrUpdate.json + */ +async function putStorageContainer(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + const result = await client.storageContainers.createOrUpdate("test-rg", "Default_Container", { + extendedLocation: { + name: "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location", + type: "CustomLocation", + }, + location: "West US2", + properties: { path: "C:\\container_storage" }, + }); + console.log(result); +} + +async function main(): Promise { + await putStorageContainer(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/storageContainersDeleteSample.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/storageContainersDeleteSample.ts new file mode 100644 index 000000000000..328c01e09b77 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/storageContainersDeleteSample.ts @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { AzureStackHCIVMManagementClient } from "@azure/arm-azurestackhcivm"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to the operation to delete a storage container. + * + * @summary the operation to delete a storage container. + * x-ms-original-file: 2025-06-01-preview/StorageContainers_Delete.json + */ +async function deleteStorageContainer(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + await client.storageContainers.delete("test-rg", "Default_Container"); +} + +async function main(): Promise { + await deleteStorageContainer(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/storageContainersGetSample.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/storageContainersGetSample.ts new file mode 100644 index 000000000000..d3aec65a8e80 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/storageContainersGetSample.ts @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { AzureStackHCIVMManagementClient } from "@azure/arm-azurestackhcivm"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to gets a storage container + * + * @summary gets a storage container + * x-ms-original-file: 2025-06-01-preview/StorageContainers_Get.json + */ +async function getStorageContainer(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + const result = await client.storageContainers.get("test-rg", "Default_Container"); + console.log(result); +} + +async function main(): Promise { + await getStorageContainer(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/storageContainersListAllSample.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/storageContainersListAllSample.ts new file mode 100644 index 000000000000..2a87b83dc987 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/storageContainersListAllSample.ts @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { AzureStackHCIVMManagementClient } from "@azure/arm-azurestackhcivm"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to lists all of the storage containers in the specified subscription. Use the nextLink property in the response to get the next page of storage containers. + * + * @summary lists all of the storage containers in the specified subscription. Use the nextLink property in the response to get the next page of storage containers. + * x-ms-original-file: 2025-06-01-preview/StorageContainers_ListAll.json + */ +async function listStorageContainerBySubscription(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.storageContainers.listAll()) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main(): Promise { + await listStorageContainerBySubscription(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/storageContainersListByResourceGroupSample.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/storageContainersListByResourceGroupSample.ts new file mode 100644 index 000000000000..27f890cc732b --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/storageContainersListByResourceGroupSample.ts @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { AzureStackHCIVMManagementClient } from "@azure/arm-azurestackhcivm"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to lists all of the storage containers in the specified resource group. Use the nextLink property in the response to get the next page of storage containers. + * + * @summary lists all of the storage containers in the specified resource group. Use the nextLink property in the response to get the next page of storage containers. + * x-ms-original-file: 2025-06-01-preview/StorageContainers_ListByResourceGroup.json + */ +async function listStorageContainerByResourceGroup(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.storageContainers.listByResourceGroup("test-rg")) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main(): Promise { + await listStorageContainerByResourceGroup(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/storageContainersUpdateSample.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/storageContainersUpdateSample.ts new file mode 100644 index 000000000000..f1e6975717bb --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/storageContainersUpdateSample.ts @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { AzureStackHCIVMManagementClient } from "@azure/arm-azurestackhcivm"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to the operation to update a storage container. + * + * @summary the operation to update a storage container. + * x-ms-original-file: 2025-06-01-preview/StorageContainers_Update.json + */ +async function updateStorageContainer(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + const result = await client.storageContainers.update("test-rg", "Default_Container", { + tags: { additionalProperties: "sample" }, + }); + console.log(result); +} + +async function main(): Promise { + await updateStorageContainer(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/virtualHardDisksCreateOrUpdateSample.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/virtualHardDisksCreateOrUpdateSample.ts new file mode 100644 index 000000000000..41d4cf76c0b6 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/virtualHardDisksCreateOrUpdateSample.ts @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { AzureStackHCIVMManagementClient } from "@azure/arm-azurestackhcivm"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to the operation to create or update a virtual hard disk. Please note some properties can be set only during virtual hard disk creation. + * + * @summary the operation to create or update a virtual hard disk. Please note some properties can be set only during virtual hard disk creation. + * x-ms-original-file: 2025-06-01-preview/VirtualHardDisks_CreateOrUpdate.json + */ +async function putVirtualHardDisk(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + const result = await client.virtualHardDisks.createOrUpdate("test-rg", "test-vhd", { + extendedLocation: { + name: "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location", + type: "CustomLocation", + }, + location: "West US2", + properties: { diskSizeGB: 32 }, + }); + console.log(result); +} + +/** + * This sample demonstrates how to the operation to create or update a virtual hard disk. Please note some properties can be set only during virtual hard disk creation. + * + * @summary the operation to create or update a virtual hard disk. Please note some properties can be set only during virtual hard disk creation. + * x-ms-original-file: 2025-06-01-preview/VirtualHardDisks__CreateOrUpdate_CreateFromLocal.json + */ +async function createVirtualHardDiskFromLocal(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + const result = await client.virtualHardDisks.createOrUpdate("test-rg", "test-vhd", { + extendedLocation: { + name: "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location", + type: "CustomLocation", + }, + location: "West US2", + properties: { + createFromLocal: true, + containerId: + "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/storageContainers/test-storage-container", + }, + }); + console.log(result); +} + +async function main(): Promise { + await putVirtualHardDisk(); + await createVirtualHardDiskFromLocal(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/virtualHardDisksDeleteSample.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/virtualHardDisksDeleteSample.ts new file mode 100644 index 000000000000..77265e60fbe7 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/virtualHardDisksDeleteSample.ts @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { AzureStackHCIVMManagementClient } from "@azure/arm-azurestackhcivm"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to the operation to delete a virtual hard disk. + * + * @summary the operation to delete a virtual hard disk. + * x-ms-original-file: 2025-06-01-preview/VirtualHardDisks_Delete.json + */ +async function deleteVirtualHardDisk(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + await client.virtualHardDisks.delete("test-rg", "test-vhd"); +} + +async function main(): Promise { + await deleteVirtualHardDisk(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/virtualHardDisksGetSample.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/virtualHardDisksGetSample.ts new file mode 100644 index 000000000000..5f69ed62f2f2 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/virtualHardDisksGetSample.ts @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { AzureStackHCIVMManagementClient } from "@azure/arm-azurestackhcivm"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to gets a virtual hard disk + * + * @summary gets a virtual hard disk + * x-ms-original-file: 2025-06-01-preview/VirtualHardDisks_Get.json + */ +async function getVirtualHardDisk(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + const result = await client.virtualHardDisks.get("test-rg", "test-vhd"); + console.log(result); +} + +async function main(): Promise { + await getVirtualHardDisk(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/virtualHardDisksListAllSample.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/virtualHardDisksListAllSample.ts new file mode 100644 index 000000000000..30ea45dec436 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/virtualHardDisksListAllSample.ts @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { AzureStackHCIVMManagementClient } from "@azure/arm-azurestackhcivm"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to lists all of the virtual hard disks in the specified subscription. Use the nextLink property in the response to get the next page of virtual hard disks. + * + * @summary lists all of the virtual hard disks in the specified subscription. Use the nextLink property in the response to get the next page of virtual hard disks. + * x-ms-original-file: 2025-06-01-preview/VirtualHardDisks_ListAll.json + */ +async function listVirtualHardDiskBySubscription(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.virtualHardDisks.listAll()) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main(): Promise { + await listVirtualHardDiskBySubscription(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/virtualHardDisksListByResourceGroupSample.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/virtualHardDisksListByResourceGroupSample.ts new file mode 100644 index 000000000000..4441317d4a7c --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/virtualHardDisksListByResourceGroupSample.ts @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { AzureStackHCIVMManagementClient } from "@azure/arm-azurestackhcivm"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to lists all of the virtual hard disks in the specified resource group. Use the nextLink property in the response to get the next page of virtual hard disks. + * + * @summary lists all of the virtual hard disks in the specified resource group. Use the nextLink property in the response to get the next page of virtual hard disks. + * x-ms-original-file: 2025-06-01-preview/VirtualHardDisks_ListByResourceGroup.json + */ +async function listVirtualHardDiskByResourceGroup(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.virtualHardDisks.listByResourceGroup("test-rg")) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main(): Promise { + await listVirtualHardDiskByResourceGroup(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/virtualHardDisksUpdateSample.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/virtualHardDisksUpdateSample.ts new file mode 100644 index 000000000000..62795e06be35 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/virtualHardDisksUpdateSample.ts @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { AzureStackHCIVMManagementClient } from "@azure/arm-azurestackhcivm"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to the operation to update a virtual hard disk. + * + * @summary the operation to update a virtual hard disk. + * x-ms-original-file: 2025-06-01-preview/VirtualHardDisks_Update.json + */ +async function updateVirtualHardDisk(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + const result = await client.virtualHardDisks.update("test-rg", "test-vhd", { + tags: { additionalProperties: "sample" }, + }); + console.log(result); +} + +async function main(): Promise { + await updateVirtualHardDisk(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/virtualHardDisksUploadSample.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/virtualHardDisksUploadSample.ts new file mode 100644 index 000000000000..0b7bb041a37a --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/virtualHardDisksUploadSample.ts @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { AzureStackHCIVMManagementClient } from "@azure/arm-azurestackhcivm"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to the operation to upload a virtual hard disk. + * + * @summary the operation to upload a virtual hard disk. + * x-ms-original-file: 2025-06-01-preview/VirtualHardDisks_Upload.json + */ +async function uploadVirtualHardDisk(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + const result = await client.virtualHardDisks.upload("test-rg", "test-vhd", { + azureManagedDiskUploadUrl: + "https://YourStorageAccountName.blob.core.windows.net/YourContainerName/YourVHDBlobName.vhd?", + }); + console.log(result); +} + +async function main(): Promise { + await uploadVirtualHardDisk(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/virtualMachineInstancesCreateOrUpdateSample.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/virtualMachineInstancesCreateOrUpdateSample.ts new file mode 100644 index 000000000000..460c337bd2b7 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/virtualMachineInstancesCreateOrUpdateSample.ts @@ -0,0 +1,294 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { AzureStackHCIVMManagementClient } from "@azure/arm-azurestackhcivm"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to the operation to create or update a virtual machine instance. Please note some properties can be set only during virtual machine instance creation. + * + * @summary the operation to create or update a virtual machine instance. Please note some properties can be set only during virtual machine instance creation. + * x-ms-original-file: 2025-06-01-preview/VirtualMachineInstances_CreateOrUpdate_Put_Virtual_Machine_Instance_With_Gallery_Image.json + */ +async function putVirtualMachineInstanceWithGalleryImage(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-00000000000"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + const result = await client.virtualMachineInstances.createOrUpdate( + "subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.HybridCompute/machines/DemoVM", + { + extendedLocation: { + name: "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location", + type: "CustomLocation", + }, + properties: { + hardwareProfile: { vmSize: "Default" }, + networkProfile: { + networkInterfaces: [ + { + id: "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/networkInterfaces/test-nic", + }, + ], + }, + osProfile: { + adminPassword: "password", + adminUsername: "localadmin", + computerName: "luamaster", + }, + securityProfile: { + enableTPM: true, + uefiSettings: { secureBootEnabled: true }, + }, + storageProfile: { + imageReference: { + id: "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/galleryImages/test-gallery-image", + }, + vmConfigStoragePathId: + "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/storageContainers/test-container", + }, + }, + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to the operation to create or update a virtual machine instance. Please note some properties can be set only during virtual machine instance creation. + * + * @summary the operation to create or update a virtual machine instance. Please note some properties can be set only during virtual machine instance creation. + * x-ms-original-file: 2025-06-01-preview/VirtualMachineInstances_CreateOrUpdate_Put_Virtual_Machine_Instance_With_Gpu.json + */ +async function putVirtualMachineInstanceWithGpu(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-00000000000"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + const result = await client.virtualMachineInstances.createOrUpdate( + "subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.HybridCompute/machines/DemoVM", + { + extendedLocation: { + name: "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location", + type: "CustomLocation", + }, + properties: { + hardwareProfile: { + vmSize: "Default", + virtualMachineGPUs: [{ assignmentType: "GpuDDA", partitionSizeMB: 0 }], + }, + networkProfile: { + networkInterfaces: [ + { + id: "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/networkInterfaces/test-nic", + }, + ], + }, + osProfile: { + adminPassword: "password", + adminUsername: "localadmin", + computerName: "luamaster", + }, + securityProfile: { + enableTPM: true, + uefiSettings: { secureBootEnabled: true }, + }, + storageProfile: { + imageReference: { + id: "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/galleryImages/test-gallery-image", + }, + vmConfigStoragePathId: + "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/storageContainers/test-container", + }, + }, + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to the operation to create or update a virtual machine instance. Please note some properties can be set only during virtual machine instance creation. + * + * @summary the operation to create or update a virtual machine instance. Please note some properties can be set only during virtual machine instance creation. + * x-ms-original-file: 2025-06-01-preview/VirtualMachineInstances_CreateOrUpdate_Put_Virtual_Machine_Instance_With_Marketplace_Gallery_Image.json + */ +async function putVirtualMachineInstanceWithMarketplaceGalleryImage(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-00000000000"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + const result = await client.virtualMachineInstances.createOrUpdate( + "subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.HybridCompute/machines/DemoVM", + { + extendedLocation: { + name: "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location", + type: "CustomLocation", + }, + properties: { + hardwareProfile: { vmSize: "Default" }, + networkProfile: { + networkInterfaces: [ + { + id: "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/networkInterfaces/test-nic", + }, + ], + }, + osProfile: { + adminPassword: "password", + adminUsername: "localadmin", + computerName: "luamaster", + }, + securityProfile: { + enableTPM: true, + uefiSettings: { secureBootEnabled: true }, + }, + storageProfile: { + imageReference: { + id: "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/marketplaceGalleryImages/test-marketplace-gallery-image", + }, + vmConfigStoragePathId: + "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/storageContainers/test-container", + }, + }, + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to the operation to create or update a virtual machine instance. Please note some properties can be set only during virtual machine instance creation. + * + * @summary the operation to create or update a virtual machine instance. Please note some properties can be set only during virtual machine instance creation. + * x-ms-original-file: 2025-06-01-preview/VirtualMachineInstances_CreateOrUpdate_Put_Virtual_Machine_Instance_With_Os_Disk.json + */ +async function putVirtualMachineInstanceWithOsDisk(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-00000000000"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + const result = await client.virtualMachineInstances.createOrUpdate( + "subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.HybridCompute/machines/DemoVM", + { + extendedLocation: { + name: "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location", + type: "CustomLocation", + }, + properties: { + hardwareProfile: { vmSize: "Default" }, + networkProfile: { + networkInterfaces: [ + { + id: "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/networkInterfaces/test-nic", + }, + ], + }, + securityProfile: { + enableTPM: true, + uefiSettings: { secureBootEnabled: true }, + }, + storageProfile: { + osDisk: { + id: "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/virtualHardDisks/test-vhd", + }, + vmConfigStoragePathId: + "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/storageContainers/test-container", + }, + }, + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to the operation to create or update a virtual machine instance. Please note some properties can be set only during virtual machine instance creation. + * + * @summary the operation to create or update a virtual machine instance. Please note some properties can be set only during virtual machine instance creation. + * x-ms-original-file: 2025-06-01-preview/VirtualMachineInstances_CreateOrUpdate_Put_Virtual_Machine_Instance_With_Vm_Config_Agent.json + */ +async function putVirtualMachineInstanceWithVMConfigAgent(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-00000000000"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + const result = await client.virtualMachineInstances.createOrUpdate( + "subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.HybridCompute/machines/DemoVM", + { + extendedLocation: { + name: "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location", + type: "CustomLocation", + }, + properties: { + hardwareProfile: { vmSize: "Default" }, + networkProfile: { + networkInterfaces: [ + { + id: "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/networkInterfaces/test-nic", + }, + ], + }, + osProfile: { + adminPassword: "password", + adminUsername: "localadmin", + computerName: "luamaster", + windowsConfiguration: { provisionVMConfigAgent: true }, + }, + securityProfile: { + enableTPM: true, + uefiSettings: { secureBootEnabled: true }, + }, + storageProfile: { + imageReference: { + id: "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/galleryImages/test-gallery-image", + }, + vmConfigStoragePathId: + "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/storageContainers/test-container", + }, + }, + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to the operation to create or update a virtual machine instance. Please note some properties can be set only during virtual machine instance creation. + * + * @summary the operation to create or update a virtual machine instance. Please note some properties can be set only during virtual machine instance creation. + * x-ms-original-file: 2025-06-01-preview/VirtualMachineInstances__CreateOrUpdate_CreateFromLocal.json + */ +async function createVirtualMachineInstanceFromLocal(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-00000000000"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + const result = await client.virtualMachineInstances.createOrUpdate( + "subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.HybridCompute/machines/DemoVM", + { + extendedLocation: { + name: "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location", + type: "CustomLocation", + }, + properties: { + networkProfile: { + networkInterfaces: [ + { + id: "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/networkInterfaces/test-nic", + }, + ], + }, + storageProfile: { + dataDisks: [ + { + id: "/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.AzureStackHCI/virtualHardDisks/test-vhd", + }, + ], + }, + createFromLocal: true, + }, + }, + ); + console.log(result); +} + +async function main(): Promise { + await putVirtualMachineInstanceWithGalleryImage(); + await putVirtualMachineInstanceWithGpu(); + await putVirtualMachineInstanceWithMarketplaceGalleryImage(); + await putVirtualMachineInstanceWithOsDisk(); + await putVirtualMachineInstanceWithVMConfigAgent(); + await createVirtualMachineInstanceFromLocal(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/virtualMachineInstancesDeleteSample.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/virtualMachineInstancesDeleteSample.ts new file mode 100644 index 000000000000..b46b35554b1b --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/virtualMachineInstancesDeleteSample.ts @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { AzureStackHCIVMManagementClient } from "@azure/arm-azurestackhcivm"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to the operation to delete a virtual machine instance. + * + * @summary the operation to delete a virtual machine instance. + * x-ms-original-file: 2025-06-01-preview/VirtualMachineInstances_Delete.json + */ +async function deleteVirtualMachine(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-00000000000"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + await client.virtualMachineInstances.delete( + "subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.HybridCompute/machines/DemoVM", + ); +} + +async function main(): Promise { + await deleteVirtualMachine(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/virtualMachineInstancesGetSample.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/virtualMachineInstancesGetSample.ts new file mode 100644 index 000000000000..c754455ce83e --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/virtualMachineInstancesGetSample.ts @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { AzureStackHCIVMManagementClient } from "@azure/arm-azurestackhcivm"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to gets a virtual machine instance + * + * @summary gets a virtual machine instance + * x-ms-original-file: 2025-06-01-preview/VirtualMachineInstances_Get.json + */ +async function getVirtualMachineInstance(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-00000000000"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + const result = await client.virtualMachineInstances.get( + "subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.HybridCompute/machines/DemoVM", + ); + console.log(result); +} + +async function main(): Promise { + await getVirtualMachineInstance(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/virtualMachineInstancesListSample.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/virtualMachineInstancesListSample.ts new file mode 100644 index 000000000000..eb8a45a79081 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/virtualMachineInstancesListSample.ts @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { AzureStackHCIVMManagementClient } from "@azure/arm-azurestackhcivm"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to lists all of the virtual machine instances within the specified parent resource. + * + * @summary lists all of the virtual machine instances within the specified parent resource. + * x-ms-original-file: 2025-06-01-preview/VirtualMachineInstances_List.json + */ +async function listVirtualMachineInstances(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-00000000000"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.virtualMachineInstances.list( + "subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.HybridCompute/machines/DemoVM", + )) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main(): Promise { + await listVirtualMachineInstances(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/virtualMachineInstancesPauseSample.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/virtualMachineInstancesPauseSample.ts new file mode 100644 index 000000000000..102c38cdaccc --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/virtualMachineInstancesPauseSample.ts @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { AzureStackHCIVMManagementClient } from "@azure/arm-azurestackhcivm"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to the operation to pause a virtual machine instance. + * + * @summary the operation to pause a virtual machine instance. + * x-ms-original-file: 2025-06-01-preview/VirtualMachineInstances_Pause.json + */ +async function pauseVirtualMachine(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-00000000000"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + await client.virtualMachineInstances.pause( + "subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/Microsoft.HybridCompute/machines/DemoVM/providers/Microsoft.AzureStackHCI/virtualMachineInstances/default", + ); +} + +async function main(): Promise { + await pauseVirtualMachine(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/virtualMachineInstancesRestartSample.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/virtualMachineInstancesRestartSample.ts new file mode 100644 index 000000000000..4147e794507b --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/virtualMachineInstancesRestartSample.ts @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { AzureStackHCIVMManagementClient } from "@azure/arm-azurestackhcivm"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to the operation to restart a virtual machine instance. + * + * @summary the operation to restart a virtual machine instance. + * x-ms-original-file: 2025-06-01-preview/VirtualMachineInstances_Restart.json + */ +async function restartVirtualMachine(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-00000000000"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + await client.virtualMachineInstances.restart( + "subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.HybridCompute/machines/DemoVM/providers/Microsoft.AzureStackHCI/virtualMachineInstances/default", + ); +} + +async function main(): Promise { + await restartVirtualMachine(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/virtualMachineInstancesSaveSample.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/virtualMachineInstancesSaveSample.ts new file mode 100644 index 000000000000..a35ffba316dd --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/virtualMachineInstancesSaveSample.ts @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { AzureStackHCIVMManagementClient } from "@azure/arm-azurestackhcivm"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to the operation to save a virtual machine instance. + * + * @summary the operation to save a virtual machine instance. + * x-ms-original-file: 2025-06-01-preview/VirtualMachineInstances_Save.json + */ +async function saveVirtualMachine(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-00000000000"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + await client.virtualMachineInstances.save( + "subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/Microsoft.HybridCompute/machines/DemoVM/providers/Microsoft.AzureStackHCI/virtualMachineInstances/default", + ); +} + +async function main(): Promise { + await saveVirtualMachine(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/virtualMachineInstancesStartSample.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/virtualMachineInstancesStartSample.ts new file mode 100644 index 000000000000..272cb70e08a2 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/virtualMachineInstancesStartSample.ts @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { AzureStackHCIVMManagementClient } from "@azure/arm-azurestackhcivm"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to the operation to start a virtual machine instance. + * + * @summary the operation to start a virtual machine instance. + * x-ms-original-file: 2025-06-01-preview/VirtualMachineInstances_Start.json + */ +async function startVirtualMachine(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-00000000000"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + await client.virtualMachineInstances.start( + "subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.HybridCompute/machines/DemoVM/providers/Microsoft.AzureStackHCI/virtualMachineInstances/default", + ); +} + +async function main(): Promise { + await startVirtualMachine(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/virtualMachineInstancesStopSample.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/virtualMachineInstancesStopSample.ts new file mode 100644 index 000000000000..992434660b91 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/virtualMachineInstancesStopSample.ts @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { AzureStackHCIVMManagementClient } from "@azure/arm-azurestackhcivm"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to the operation to stop a virtual machine instance. + * + * @summary the operation to stop a virtual machine instance. + * x-ms-original-file: 2025-06-01-preview/VirtualMachineInstances_Stop.json + */ +async function stopVirtualMachine(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-00000000000"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + await client.virtualMachineInstances.stop( + "subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.HybridCompute/machines/DemoVM/providers/Microsoft.AzureStackHCI/virtualMachineInstances/default", + ); +} + +async function main(): Promise { + await stopVirtualMachine(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/virtualMachineInstancesUpdateSample.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/virtualMachineInstancesUpdateSample.ts new file mode 100644 index 000000000000..8bc4c51846b0 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples-dev/virtualMachineInstancesUpdateSample.ts @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { AzureStackHCIVMManagementClient } from "@azure/arm-azurestackhcivm"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to the operation to update a virtual machine instance. + * + * @summary the operation to update a virtual machine instance. + * x-ms-original-file: 2025-06-01-preview/VirtualMachineInstances_Update.json + */ +async function updateVirtualMachine(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-00000000000"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + const result = await client.virtualMachineInstances.update( + "subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.HybridCompute/machines/DemoVM", + { + properties: { + storageProfile: { + dataDisks: [ + { + id: "/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.AzureStackHCI/virtualHardDisks/test-vhd", + }, + ], + }, + }, + }, + ); + console.log(result); +} + +async function main(): Promise { + await updateVirtualMachine(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/README.md b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/README.md new file mode 100644 index 000000000000..c0f52c12339e --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/README.md @@ -0,0 +1,176 @@ +# @azure/arm-azurestackhcivm client library samples for JavaScript (Beta) + +These sample programs show how to use the JavaScript client libraries for @azure/arm-azurestackhcivm in some common scenarios. + +| **File Name** | **Description** | +| ----------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| [attestationStatusesGetSample.js][attestationstatusesgetsample] | implements AttestationStatus GET method. x-ms-original-file: 2025-06-01-preview/AttestationStatuses_Get.json | +| [galleryImagesCreateOrUpdateSample.js][galleryimagescreateorupdatesample] | the operation to create or update a gallery image. Please note some properties can be set only during gallery image creation. x-ms-original-file: 2025-06-01-preview/GalleryImages_CreateOrUpdate.json | +| [galleryImagesDeleteSample.js][galleryimagesdeletesample] | the operation to delete a gallery image. x-ms-original-file: 2025-06-01-preview/GalleryImages_Delete.json | +| [galleryImagesGetSample.js][galleryimagesgetsample] | gets a gallery image x-ms-original-file: 2025-06-01-preview/GalleryImages_Get.json | +| [galleryImagesListAllSample.js][galleryimageslistallsample] | lists all of the gallery images in the specified subscription. Use the nextLink property in the response to get the next page of gallery images. x-ms-original-file: 2025-06-01-preview/GalleryImages_ListAll.json | +| [galleryImagesListByResourceGroupSample.js][galleryimageslistbyresourcegroupsample] | lists all of the gallery images in the specified resource group. Use the nextLink property in the response to get the next page of gallery images. x-ms-original-file: 2025-06-01-preview/GalleryImages_ListByResourceGroup.json | +| [galleryImagesUpdateSample.js][galleryimagesupdatesample] | the operation to update a gallery image. x-ms-original-file: 2025-06-01-preview/GalleryImages_Update.json | +| [guestAgentsCreateSample.js][guestagentscreatesample] | create Or Update GuestAgent. x-ms-original-file: 2025-06-01-preview/GuestAgents_Create.json | +| [guestAgentsDeleteSample.js][guestagentsdeletesample] | implements GuestAgent DELETE method. x-ms-original-file: 2025-06-01-preview/GuestAgents_Delete.json | +| [guestAgentsGetSample.js][guestagentsgetsample] | implements GuestAgent GET method. x-ms-original-file: 2025-06-01-preview/GuestAgents_Get.json | +| [guestAgentsListByVirtualMachineInstanceSample.js][guestagentslistbyvirtualmachineinstancesample] | returns the list of GuestAgent of the given vm. x-ms-original-file: 2025-06-01-preview/GuestAgents_ListByVirtualMachineInstance.json | +| [hybridIdentityMetadataGetSample.js][hybrididentitymetadatagetsample] | implements HybridIdentityMetadata GET method. x-ms-original-file: 2025-06-01-preview/HybridIdentityMetadataGroup_Get.json | +| [hybridIdentityMetadataListByVirtualMachineInstanceSample.js][hybrididentitymetadatalistbyvirtualmachineinstancesample] | returns the list of HybridIdentityMetadata of the given vm. x-ms-original-file: 2025-06-01-preview/HybridIdentityMetadata_ListByVirtualMachineInstance.json | +| [logicalNetworksCreateOrUpdateSample.js][logicalnetworkscreateorupdatesample] | the operation to create or update a logical network. Please note some properties can be set only during logical network creation. x-ms-original-file: 2025-06-01-preview/LogicalNetworks_CreateOrUpdate.json | +| [logicalNetworksDeleteSample.js][logicalnetworksdeletesample] | the operation to delete a logical network. x-ms-original-file: 2025-06-01-preview/LogicalNetworks_Delete.json | +| [logicalNetworksGetSample.js][logicalnetworksgetsample] | the operation to get a logical network. x-ms-original-file: 2025-06-01-preview/LogicalNetworks_Get.json | +| [logicalNetworksListAllSample.js][logicalnetworkslistallsample] | lists all of the logical networks in the specified subscription. Use the nextLink property in the response to get the next page of logical networks. x-ms-original-file: 2025-06-01-preview/LogicalNetworks_ListAll.json | +| [logicalNetworksListByResourceGroupSample.js][logicalnetworkslistbyresourcegroupsample] | lists all of the logical networks in the specified resource group. Use the nextLink property in the response to get the next page of logical networks. x-ms-original-file: 2025-06-01-preview/LogicalNetworks_ListByResourceGroup.json | +| [logicalNetworksUpdateSample.js][logicalnetworksupdatesample] | the operation to update a logical network. x-ms-original-file: 2025-06-01-preview/LogicalNetworks_Update.json | +| [marketplaceGalleryImagesCreateOrUpdateSample.js][marketplacegalleryimagescreateorupdatesample] | the operation to create or update a marketplace gallery image. Please note some properties can be set only during marketplace gallery image creation. x-ms-original-file: 2025-06-01-preview/MarketplaceGalleryImages_CreateOrUpdate.json | +| [marketplaceGalleryImagesDeleteSample.js][marketplacegalleryimagesdeletesample] | the operation to delete a marketplace gallery image. x-ms-original-file: 2025-06-01-preview/MarketplaceGalleryImages_Delete.json | +| [marketplaceGalleryImagesGetSample.js][marketplacegalleryimagesgetsample] | gets a marketplace gallery image x-ms-original-file: 2025-06-01-preview/MarketplaceGalleryImages_Get.json | +| [marketplaceGalleryImagesListAllSample.js][marketplacegalleryimageslistallsample] | lists all of the marketplace gallery images in the specified subscription. Use the nextLink property in the response to get the next page of marketplace gallery images. x-ms-original-file: 2025-06-01-preview/MarketplaceGalleryImages_ListAll.json | +| [marketplaceGalleryImagesListByResourceGroupSample.js][marketplacegalleryimageslistbyresourcegroupsample] | lists all of the marketplace gallery images in the specified resource group. Use the nextLink property in the response to get the next page of marketplace gallery images. x-ms-original-file: 2025-06-01-preview/MarketplaceGalleryImages_ListByResourceGroup.json | +| [marketplaceGalleryImagesUpdateSample.js][marketplacegalleryimagesupdatesample] | the operation to update a marketplace gallery image. x-ms-original-file: 2025-06-01-preview/MarketplaceGalleryImages_Update.json | +| [networkInterfacesCreateOrUpdateSample.js][networkinterfacescreateorupdatesample] | the operation to create or update a network interface. Please note some properties can be set only during network interface creation. x-ms-original-file: 2025-06-01-preview/NetworkInterfaces_CreateOrUpdate.json | +| [networkInterfacesDeleteSample.js][networkinterfacesdeletesample] | the operation to delete a network interface. x-ms-original-file: 2025-06-01-preview/NetworkInterfaces_Delete.json | +| [networkInterfacesGetSample.js][networkinterfacesgetsample] | gets a network interface x-ms-original-file: 2025-06-01-preview/NetworkInterfaces_Get.json | +| [networkInterfacesListAllSample.js][networkinterfaceslistallsample] | lists all of the network interfaces in the specified subscription. Use the nextLink property in the response to get the next page of network interfaces. x-ms-original-file: 2025-06-01-preview/NetworkInterfaces_ListAll.json | +| [networkInterfacesListByResourceGroupSample.js][networkinterfaceslistbyresourcegroupsample] | lists all of the network interfaces in the specified resource group. Use the nextLink property in the response to get the next page of network interfaces. x-ms-original-file: 2025-06-01-preview/NetworkInterfaces_ListByResourceGroup.json | +| [networkInterfacesUpdateSample.js][networkinterfacesupdatesample] | the operation to update a network interface. x-ms-original-file: 2025-06-01-preview/NetworkInterfaces_Update.json | +| [networkSecurityGroupsCreateOrUpdateSample.js][networksecuritygroupscreateorupdatesample] | creates or updates a network security group in the specified resource group. x-ms-original-file: 2025-06-01-preview/NetworkSecurityGroups_CreateOrUpdate.json | +| [networkSecurityGroupsDeleteSample.js][networksecuritygroupsdeletesample] | deletes the specified network security group. x-ms-original-file: 2025-06-01-preview/NetworkSecurityGroups_Delete.json | +| [networkSecurityGroupsGetSample.js][networksecuritygroupsgetsample] | gets the specified network security group. x-ms-original-file: 2025-06-01-preview/NetworkSecurityGroups_Get.json | +| [networkSecurityGroupsListAllSample.js][networksecuritygroupslistallsample] | gets all network security groups in a subscription. x-ms-original-file: 2025-06-01-preview/NetworkSecurityGroups_ListAll.json | +| [networkSecurityGroupsListByResourceGroupSample.js][networksecuritygroupslistbyresourcegroupsample] | gets all network security groups in a resource group. x-ms-original-file: 2025-06-01-preview/NetworkSecurityGroups_ListByResourceGroup.json | +| [networkSecurityGroupsUpdateTagsSample.js][networksecuritygroupsupdatetagssample] | updates a network security group tags. x-ms-original-file: 2025-06-01-preview/NetworkSecurityGroups_UpdateTags.json | +| [securityRulesCreateOrUpdateSample.js][securityrulescreateorupdatesample] | creates or updates a security rule in the specified resource group. x-ms-original-file: 2025-06-01-preview/SecurityRules_CreateOrUpdate.json | +| [securityRulesDeleteSample.js][securityrulesdeletesample] | deletes the specified security rule. x-ms-original-file: 2025-06-01-preview/SecurityRules_Delete.json | +| [securityRulesGetSample.js][securityrulesgetsample] | gets the specified security rule. x-ms-original-file: 2025-06-01-preview/SecurityRules_Get.json | +| [securityRulesListByNetworkSecurityGroupSample.js][securityruleslistbynetworksecuritygroupsample] | gets all security rules in a Network Security Group. x-ms-original-file: 2025-06-01-preview/SecurityRules_ListByNetworkSecurityGroup.json | +| [storageContainersCreateOrUpdateSample.js][storagecontainerscreateorupdatesample] | the operation to create or update a storage container. Please note some properties can be set only during storage container creation. x-ms-original-file: 2025-06-01-preview/StorageContainers_CreateOrUpdate.json | +| [storageContainersDeleteSample.js][storagecontainersdeletesample] | the operation to delete a storage container. x-ms-original-file: 2025-06-01-preview/StorageContainers_Delete.json | +| [storageContainersGetSample.js][storagecontainersgetsample] | gets a storage container x-ms-original-file: 2025-06-01-preview/StorageContainers_Get.json | +| [storageContainersListAllSample.js][storagecontainerslistallsample] | lists all of the storage containers in the specified subscription. Use the nextLink property in the response to get the next page of storage containers. x-ms-original-file: 2025-06-01-preview/StorageContainers_ListAll.json | +| [storageContainersListByResourceGroupSample.js][storagecontainerslistbyresourcegroupsample] | lists all of the storage containers in the specified resource group. Use the nextLink property in the response to get the next page of storage containers. x-ms-original-file: 2025-06-01-preview/StorageContainers_ListByResourceGroup.json | +| [storageContainersUpdateSample.js][storagecontainersupdatesample] | the operation to update a storage container. x-ms-original-file: 2025-06-01-preview/StorageContainers_Update.json | +| [virtualHardDisksCreateOrUpdateSample.js][virtualharddiskscreateorupdatesample] | the operation to create or update a virtual hard disk. Please note some properties can be set only during virtual hard disk creation. x-ms-original-file: 2025-06-01-preview/VirtualHardDisks_CreateOrUpdate.json | +| [virtualHardDisksDeleteSample.js][virtualharddisksdeletesample] | the operation to delete a virtual hard disk. x-ms-original-file: 2025-06-01-preview/VirtualHardDisks_Delete.json | +| [virtualHardDisksGetSample.js][virtualharddisksgetsample] | gets a virtual hard disk x-ms-original-file: 2025-06-01-preview/VirtualHardDisks_Get.json | +| [virtualHardDisksListAllSample.js][virtualharddiskslistallsample] | lists all of the virtual hard disks in the specified subscription. Use the nextLink property in the response to get the next page of virtual hard disks. x-ms-original-file: 2025-06-01-preview/VirtualHardDisks_ListAll.json | +| [virtualHardDisksListByResourceGroupSample.js][virtualharddiskslistbyresourcegroupsample] | lists all of the virtual hard disks in the specified resource group. Use the nextLink property in the response to get the next page of virtual hard disks. x-ms-original-file: 2025-06-01-preview/VirtualHardDisks_ListByResourceGroup.json | +| [virtualHardDisksUpdateSample.js][virtualharddisksupdatesample] | the operation to update a virtual hard disk. x-ms-original-file: 2025-06-01-preview/VirtualHardDisks_Update.json | +| [virtualHardDisksUploadSample.js][virtualharddisksuploadsample] | the operation to upload a virtual hard disk. x-ms-original-file: 2025-06-01-preview/VirtualHardDisks_Upload.json | +| [virtualMachineInstancesCreateOrUpdateSample.js][virtualmachineinstancescreateorupdatesample] | the operation to create or update a virtual machine instance. Please note some properties can be set only during virtual machine instance creation. x-ms-original-file: 2025-06-01-preview/VirtualMachineInstances_CreateOrUpdate_Put_Virtual_Machine_Instance_With_Gallery_Image.json | +| [virtualMachineInstancesDeleteSample.js][virtualmachineinstancesdeletesample] | the operation to delete a virtual machine instance. x-ms-original-file: 2025-06-01-preview/VirtualMachineInstances_Delete.json | +| [virtualMachineInstancesGetSample.js][virtualmachineinstancesgetsample] | gets a virtual machine instance x-ms-original-file: 2025-06-01-preview/VirtualMachineInstances_Get.json | +| [virtualMachineInstancesListSample.js][virtualmachineinstanceslistsample] | lists all of the virtual machine instances within the specified parent resource. x-ms-original-file: 2025-06-01-preview/VirtualMachineInstances_List.json | +| [virtualMachineInstancesPauseSample.js][virtualmachineinstancespausesample] | the operation to pause a virtual machine instance. x-ms-original-file: 2025-06-01-preview/VirtualMachineInstances_Pause.json | +| [virtualMachineInstancesRestartSample.js][virtualmachineinstancesrestartsample] | the operation to restart a virtual machine instance. x-ms-original-file: 2025-06-01-preview/VirtualMachineInstances_Restart.json | +| [virtualMachineInstancesSaveSample.js][virtualmachineinstancessavesample] | the operation to save a virtual machine instance. x-ms-original-file: 2025-06-01-preview/VirtualMachineInstances_Save.json | +| [virtualMachineInstancesStartSample.js][virtualmachineinstancesstartsample] | the operation to start a virtual machine instance. x-ms-original-file: 2025-06-01-preview/VirtualMachineInstances_Start.json | +| [virtualMachineInstancesStopSample.js][virtualmachineinstancesstopsample] | the operation to stop a virtual machine instance. x-ms-original-file: 2025-06-01-preview/VirtualMachineInstances_Stop.json | +| [virtualMachineInstancesUpdateSample.js][virtualmachineinstancesupdatesample] | the operation to update a virtual machine instance. x-ms-original-file: 2025-06-01-preview/VirtualMachineInstances_Update.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 attestationStatusesGetSample.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 attestationStatusesGetSample.js +``` + +## Next Steps + +Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients. + +[attestationstatusesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/attestationStatusesGetSample.js +[galleryimagescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/galleryImagesCreateOrUpdateSample.js +[galleryimagesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/galleryImagesDeleteSample.js +[galleryimagesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/galleryImagesGetSample.js +[galleryimageslistallsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/galleryImagesListAllSample.js +[galleryimageslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/galleryImagesListByResourceGroupSample.js +[galleryimagesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/galleryImagesUpdateSample.js +[guestagentscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/guestAgentsCreateSample.js +[guestagentsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/guestAgentsDeleteSample.js +[guestagentsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/guestAgentsGetSample.js +[guestagentslistbyvirtualmachineinstancesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/guestAgentsListByVirtualMachineInstanceSample.js +[hybrididentitymetadatagetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/hybridIdentityMetadataGetSample.js +[hybrididentitymetadatalistbyvirtualmachineinstancesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/hybridIdentityMetadataListByVirtualMachineInstanceSample.js +[logicalnetworkscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/logicalNetworksCreateOrUpdateSample.js +[logicalnetworksdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/logicalNetworksDeleteSample.js +[logicalnetworksgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/logicalNetworksGetSample.js +[logicalnetworkslistallsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/logicalNetworksListAllSample.js +[logicalnetworkslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/logicalNetworksListByResourceGroupSample.js +[logicalnetworksupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/logicalNetworksUpdateSample.js +[marketplacegalleryimagescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/marketplaceGalleryImagesCreateOrUpdateSample.js +[marketplacegalleryimagesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/marketplaceGalleryImagesDeleteSample.js +[marketplacegalleryimagesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/marketplaceGalleryImagesGetSample.js +[marketplacegalleryimageslistallsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/marketplaceGalleryImagesListAllSample.js +[marketplacegalleryimageslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/marketplaceGalleryImagesListByResourceGroupSample.js +[marketplacegalleryimagesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/marketplaceGalleryImagesUpdateSample.js +[networkinterfacescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/networkInterfacesCreateOrUpdateSample.js +[networkinterfacesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/networkInterfacesDeleteSample.js +[networkinterfacesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/networkInterfacesGetSample.js +[networkinterfaceslistallsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/networkInterfacesListAllSample.js +[networkinterfaceslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/networkInterfacesListByResourceGroupSample.js +[networkinterfacesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/networkInterfacesUpdateSample.js +[networksecuritygroupscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/networkSecurityGroupsCreateOrUpdateSample.js +[networksecuritygroupsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/networkSecurityGroupsDeleteSample.js +[networksecuritygroupsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/networkSecurityGroupsGetSample.js +[networksecuritygroupslistallsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/networkSecurityGroupsListAllSample.js +[networksecuritygroupslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/networkSecurityGroupsListByResourceGroupSample.js +[networksecuritygroupsupdatetagssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/networkSecurityGroupsUpdateTagsSample.js +[securityrulescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/securityRulesCreateOrUpdateSample.js +[securityrulesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/securityRulesDeleteSample.js +[securityrulesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/securityRulesGetSample.js +[securityruleslistbynetworksecuritygroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/securityRulesListByNetworkSecurityGroupSample.js +[storagecontainerscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/storageContainersCreateOrUpdateSample.js +[storagecontainersdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/storageContainersDeleteSample.js +[storagecontainersgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/storageContainersGetSample.js +[storagecontainerslistallsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/storageContainersListAllSample.js +[storagecontainerslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/storageContainersListByResourceGroupSample.js +[storagecontainersupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/storageContainersUpdateSample.js +[virtualharddiskscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/virtualHardDisksCreateOrUpdateSample.js +[virtualharddisksdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/virtualHardDisksDeleteSample.js +[virtualharddisksgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/virtualHardDisksGetSample.js +[virtualharddiskslistallsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/virtualHardDisksListAllSample.js +[virtualharddiskslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/virtualHardDisksListByResourceGroupSample.js +[virtualharddisksupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/virtualHardDisksUpdateSample.js +[virtualharddisksuploadsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/virtualHardDisksUploadSample.js +[virtualmachineinstancescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/virtualMachineInstancesCreateOrUpdateSample.js +[virtualmachineinstancesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/virtualMachineInstancesDeleteSample.js +[virtualmachineinstancesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/virtualMachineInstancesGetSample.js +[virtualmachineinstanceslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/virtualMachineInstancesListSample.js +[virtualmachineinstancespausesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/virtualMachineInstancesPauseSample.js +[virtualmachineinstancesrestartsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/virtualMachineInstancesRestartSample.js +[virtualmachineinstancessavesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/virtualMachineInstancesSaveSample.js +[virtualmachineinstancesstartsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/virtualMachineInstancesStartSample.js +[virtualmachineinstancesstopsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/virtualMachineInstancesStopSample.js +[virtualmachineinstancesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/virtualMachineInstancesUpdateSample.js +[apiref]: https://learn.microsoft.com/javascript/api/@azure/arm-azurestackhcivm?view=azure-node-preview +[freesub]: https://azure.microsoft.com/free/ +[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/azurestackhcivm/arm-azurestackhcivm/README.md diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/attestationStatusesGetSample.js b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/attestationStatusesGetSample.js new file mode 100644 index 000000000000..b054586a9b6d --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/attestationStatusesGetSample.js @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { AzureStackHCIVMManagementClient } = require("@azure/arm-azurestackhcivm"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to implements AttestationStatus GET method. + * + * @summary implements AttestationStatus GET method. + * x-ms-original-file: 2025-06-01-preview/AttestationStatuses_Get.json + */ +async function getAttestationStatus() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-00000000000"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + const result = await client.attestationStatuses.get( + "subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.HybridCompute/machines/DemoVM", + ); + console.log(result); +} + +async function main() { + await getAttestationStatus(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/galleryImagesCreateOrUpdateSample.js b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/galleryImagesCreateOrUpdateSample.js new file mode 100644 index 000000000000..78d92aa3e0ac --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/galleryImagesCreateOrUpdateSample.js @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { AzureStackHCIVMManagementClient } = require("@azure/arm-azurestackhcivm"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to the operation to create or update a gallery image. Please note some properties can be set only during gallery image creation. + * + * @summary the operation to create or update a gallery image. Please note some properties can be set only during gallery image creation. + * x-ms-original-file: 2025-06-01-preview/GalleryImages_CreateOrUpdate.json + */ +async function putGalleryImage() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + const result = await client.galleryImages.createOrUpdate("test-rg", "test-gallery-image", { + extendedLocation: { + name: "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location", + type: "CustomLocation", + }, + location: "West US2", + properties: { + containerId: + "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/storageContainers/test-storage-container", + imagePath: "C:\\test.vhdx", + osType: "Linux", + }, + }); + console.log(result); +} + +async function main() { + await putGalleryImage(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/galleryImagesDeleteSample.js b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/galleryImagesDeleteSample.js new file mode 100644 index 000000000000..9da432986dd4 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/galleryImagesDeleteSample.js @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { AzureStackHCIVMManagementClient } = require("@azure/arm-azurestackhcivm"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to the operation to delete a gallery image. + * + * @summary the operation to delete a gallery image. + * x-ms-original-file: 2025-06-01-preview/GalleryImages_Delete.json + */ +async function deleteGalleryImage() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + await client.galleryImages.delete("test-rg", "test-gallery-image"); +} + +async function main() { + await deleteGalleryImage(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/galleryImagesGetSample.js b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/galleryImagesGetSample.js new file mode 100644 index 000000000000..318494b06c1e --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/galleryImagesGetSample.js @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { AzureStackHCIVMManagementClient } = require("@azure/arm-azurestackhcivm"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to gets a gallery image + * + * @summary gets a gallery image + * x-ms-original-file: 2025-06-01-preview/GalleryImages_Get.json + */ +async function getGalleryImage() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + const result = await client.galleryImages.get("test-rg", "test-gallery-image"); + console.log(result); +} + +async function main() { + await getGalleryImage(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/galleryImagesListAllSample.js b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/galleryImagesListAllSample.js new file mode 100644 index 000000000000..0c18c86c7162 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/galleryImagesListAllSample.js @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { AzureStackHCIVMManagementClient } = require("@azure/arm-azurestackhcivm"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to lists all of the gallery images in the specified subscription. Use the nextLink property in the response to get the next page of gallery images. + * + * @summary lists all of the gallery images in the specified subscription. Use the nextLink property in the response to get the next page of gallery images. + * x-ms-original-file: 2025-06-01-preview/GalleryImages_ListAll.json + */ +async function listGalleryImageBySubscription() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.galleryImages.listAll()) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main() { + await listGalleryImageBySubscription(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/galleryImagesListByResourceGroupSample.js b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/galleryImagesListByResourceGroupSample.js new file mode 100644 index 000000000000..201a6a59b607 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/galleryImagesListByResourceGroupSample.js @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { AzureStackHCIVMManagementClient } = require("@azure/arm-azurestackhcivm"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to lists all of the gallery images in the specified resource group. Use the nextLink property in the response to get the next page of gallery images. + * + * @summary lists all of the gallery images in the specified resource group. Use the nextLink property in the response to get the next page of gallery images. + * x-ms-original-file: 2025-06-01-preview/GalleryImages_ListByResourceGroup.json + */ +async function listGalleryImageByResourceGroup() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.galleryImages.listByResourceGroup("test-rg")) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main() { + await listGalleryImageByResourceGroup(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/galleryImagesUpdateSample.js b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/galleryImagesUpdateSample.js new file mode 100644 index 000000000000..7901716e6e79 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/galleryImagesUpdateSample.js @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { AzureStackHCIVMManagementClient } = require("@azure/arm-azurestackhcivm"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to the operation to update a gallery image. + * + * @summary the operation to update a gallery image. + * x-ms-original-file: 2025-06-01-preview/GalleryImages_Update.json + */ +async function updateGalleryImage() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + const result = await client.galleryImages.update("test-rg", "test-gallery-image", { + tags: { additionalProperties: "sample" }, + }); + console.log(result); +} + +async function main() { + await updateGalleryImage(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/guestAgentsCreateSample.js b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/guestAgentsCreateSample.js new file mode 100644 index 000000000000..6c7a092280c4 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/guestAgentsCreateSample.js @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { AzureStackHCIVMManagementClient } = require("@azure/arm-azurestackhcivm"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to create Or Update GuestAgent. + * + * @summary create Or Update GuestAgent. + * x-ms-original-file: 2025-06-01-preview/GuestAgents_Create.json + */ +async function createGuestAgent() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-00000000000"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + const result = await client.guestAgents.create( + "subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.HybridCompute/machines/DemoVM", + { + properties: { + credentials: { password: "", username: "tempuser" }, + provisioningAction: "install", + }, + }, + ); + console.log(result); +} + +async function main() { + await createGuestAgent(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/guestAgentsDeleteSample.js b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/guestAgentsDeleteSample.js new file mode 100644 index 000000000000..3d455e9096bd --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/guestAgentsDeleteSample.js @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { AzureStackHCIVMManagementClient } = require("@azure/arm-azurestackhcivm"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to implements GuestAgent DELETE method. + * + * @summary implements GuestAgent DELETE method. + * x-ms-original-file: 2025-06-01-preview/GuestAgents_Delete.json + */ +async function deleteGuestAgent() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-00000000000"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + await client.guestAgents.delete( + "subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.HybridCompute/machines/DemoVM", + ); +} + +async function main() { + await deleteGuestAgent(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/guestAgentsGetSample.js b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/guestAgentsGetSample.js new file mode 100644 index 000000000000..1f646c62366f --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/guestAgentsGetSample.js @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { AzureStackHCIVMManagementClient } = require("@azure/arm-azurestackhcivm"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to implements GuestAgent GET method. + * + * @summary implements GuestAgent GET method. + * x-ms-original-file: 2025-06-01-preview/GuestAgents_Get.json + */ +async function getGuestAgent() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-00000000000"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + const result = await client.guestAgents.get( + "subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.HybridCompute/machines/DemoVM", + ); + console.log(result); +} + +async function main() { + await getGuestAgent(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/guestAgentsListByVirtualMachineInstanceSample.js b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/guestAgentsListByVirtualMachineInstanceSample.js new file mode 100644 index 000000000000..5168bc4f34ff --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/guestAgentsListByVirtualMachineInstanceSample.js @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { AzureStackHCIVMManagementClient } = require("@azure/arm-azurestackhcivm"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to returns the list of GuestAgent of the given vm. + * + * @summary returns the list of GuestAgent of the given vm. + * x-ms-original-file: 2025-06-01-preview/GuestAgents_ListByVirtualMachineInstance.json + */ +async function guestAgentListByVirtualMachineInstances() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-00000000000"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.guestAgents.listByVirtualMachineInstance( + "subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.HybridCompute/machines/DemoVM", + )) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main() { + await guestAgentListByVirtualMachineInstances(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/hybridIdentityMetadataGetSample.js b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/hybridIdentityMetadataGetSample.js new file mode 100644 index 000000000000..60bd2d4114e5 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/hybridIdentityMetadataGetSample.js @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { AzureStackHCIVMManagementClient } = require("@azure/arm-azurestackhcivm"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to implements HybridIdentityMetadata GET method. + * + * @summary implements HybridIdentityMetadata GET method. + * x-ms-original-file: 2025-06-01-preview/HybridIdentityMetadataGroup_Get.json + */ +async function getHybridIdentityMetadata() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-00000000000"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + const result = await client.hybridIdentityMetadata.get( + "subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.HybridCompute/machines/DemoVM", + ); + console.log(result); +} + +async function main() { + await getHybridIdentityMetadata(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/hybridIdentityMetadataListByVirtualMachineInstanceSample.js b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/hybridIdentityMetadataListByVirtualMachineInstanceSample.js new file mode 100644 index 000000000000..42ac5c7eb96c --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/hybridIdentityMetadataListByVirtualMachineInstanceSample.js @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { AzureStackHCIVMManagementClient } = require("@azure/arm-azurestackhcivm"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to returns the list of HybridIdentityMetadata of the given vm. + * + * @summary returns the list of HybridIdentityMetadata of the given vm. + * x-ms-original-file: 2025-06-01-preview/HybridIdentityMetadata_ListByVirtualMachineInstance.json + */ +async function hybridIdentityMetadataListByVirtualMachineInstances() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-00000000000"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.hybridIdentityMetadata.listByVirtualMachineInstance( + "subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.HybridCompute/machines/DemoVM", + )) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main() { + await hybridIdentityMetadataListByVirtualMachineInstances(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/logicalNetworksCreateOrUpdateSample.js b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/logicalNetworksCreateOrUpdateSample.js new file mode 100644 index 000000000000..e072c242cdf7 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/logicalNetworksCreateOrUpdateSample.js @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { AzureStackHCIVMManagementClient } = require("@azure/arm-azurestackhcivm"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to the operation to create or update a logical network. Please note some properties can be set only during logical network creation. + * + * @summary the operation to create or update a logical network. Please note some properties can be set only during logical network creation. + * x-ms-original-file: 2025-06-01-preview/LogicalNetworks_CreateOrUpdate.json + */ +async function putLogicalNetwork() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + const result = await client.logicalNetworks.createOrUpdate("test-rg", "test-lnet", { + extendedLocation: { + name: "/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location", + type: "CustomLocation", + }, + location: "West US2", + }); + console.log(result); +} + +async function main() { + await putLogicalNetwork(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/logicalNetworksDeleteSample.js b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/logicalNetworksDeleteSample.js new file mode 100644 index 000000000000..98039c64fada --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/logicalNetworksDeleteSample.js @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { AzureStackHCIVMManagementClient } = require("@azure/arm-azurestackhcivm"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to the operation to delete a logical network. + * + * @summary the operation to delete a logical network. + * x-ms-original-file: 2025-06-01-preview/LogicalNetworks_Delete.json + */ +async function deleteLogicalNetwork() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + await client.logicalNetworks.delete("test-rg", "test-lnet"); +} + +async function main() { + await deleteLogicalNetwork(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/logicalNetworksGetSample.js b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/logicalNetworksGetSample.js new file mode 100644 index 000000000000..6d0043b51786 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/logicalNetworksGetSample.js @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { AzureStackHCIVMManagementClient } = require("@azure/arm-azurestackhcivm"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to the operation to get a logical network. + * + * @summary the operation to get a logical network. + * x-ms-original-file: 2025-06-01-preview/LogicalNetworks_Get.json + */ +async function getLogicalNetwork() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + const result = await client.logicalNetworks.get("test-rg", "test-lnet"); + console.log(result); +} + +async function main() { + await getLogicalNetwork(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/logicalNetworksListAllSample.js b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/logicalNetworksListAllSample.js new file mode 100644 index 000000000000..c657f179f5eb --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/logicalNetworksListAllSample.js @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { AzureStackHCIVMManagementClient } = require("@azure/arm-azurestackhcivm"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to lists all of the logical networks in the specified subscription. Use the nextLink property in the response to get the next page of logical networks. + * + * @summary lists all of the logical networks in the specified subscription. Use the nextLink property in the response to get the next page of logical networks. + * x-ms-original-file: 2025-06-01-preview/LogicalNetworks_ListAll.json + */ +async function listLogicalNetworkBySubscription() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.logicalNetworks.listAll()) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main() { + await listLogicalNetworkBySubscription(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/logicalNetworksListByResourceGroupSample.js b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/logicalNetworksListByResourceGroupSample.js new file mode 100644 index 000000000000..a1ff0e59bc50 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/logicalNetworksListByResourceGroupSample.js @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { AzureStackHCIVMManagementClient } = require("@azure/arm-azurestackhcivm"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to lists all of the logical networks in the specified resource group. Use the nextLink property in the response to get the next page of logical networks. + * + * @summary lists all of the logical networks in the specified resource group. Use the nextLink property in the response to get the next page of logical networks. + * x-ms-original-file: 2025-06-01-preview/LogicalNetworks_ListByResourceGroup.json + */ +async function listLogicalNetworkByResourceGroup() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.logicalNetworks.listByResourceGroup("test-rg")) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main() { + await listLogicalNetworkByResourceGroup(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/logicalNetworksUpdateSample.js b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/logicalNetworksUpdateSample.js new file mode 100644 index 000000000000..ddb9d8ce575b --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/logicalNetworksUpdateSample.js @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { AzureStackHCIVMManagementClient } = require("@azure/arm-azurestackhcivm"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to the operation to update a logical network. + * + * @summary the operation to update a logical network. + * x-ms-original-file: 2025-06-01-preview/LogicalNetworks_Update.json + */ +async function updateLogicalNetwork() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + const result = await client.logicalNetworks.update("test-rg", "test-lnet", { + tags: { additionalProperties: "sample" }, + }); + console.log(result); +} + +async function main() { + await updateLogicalNetwork(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/marketplaceGalleryImagesCreateOrUpdateSample.js b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/marketplaceGalleryImagesCreateOrUpdateSample.js new file mode 100644 index 000000000000..69fd2df792b8 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/marketplaceGalleryImagesCreateOrUpdateSample.js @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { AzureStackHCIVMManagementClient } = require("@azure/arm-azurestackhcivm"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to the operation to create or update a marketplace gallery image. Please note some properties can be set only during marketplace gallery image creation. + * + * @summary the operation to create or update a marketplace gallery image. Please note some properties can be set only during marketplace gallery image creation. + * x-ms-original-file: 2025-06-01-preview/MarketplaceGalleryImages_CreateOrUpdate.json + */ +async function putMarketplaceGalleryImage() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + const result = await client.marketplaceGalleryImages.createOrUpdate( + "test-rg", + "test-marketplace-gallery-image", + { + extendedLocation: { + name: "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location", + type: "CustomLocation", + }, + location: "West US2", + properties: { + cloudInitDataSource: "Azure", + containerId: + "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/storageContainers/test-storage-container", + hyperVGeneration: "V1", + identifier: { + offer: "myOfferName", + publisher: "myPublisherName", + sku: "mySkuName", + }, + osType: "Windows", + version: { name: "1.0.0" }, + }, + }, + ); + console.log(result); +} + +async function main() { + await putMarketplaceGalleryImage(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/marketplaceGalleryImagesDeleteSample.js b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/marketplaceGalleryImagesDeleteSample.js new file mode 100644 index 000000000000..e1bc12d9984b --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/marketplaceGalleryImagesDeleteSample.js @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { AzureStackHCIVMManagementClient } = require("@azure/arm-azurestackhcivm"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to the operation to delete a marketplace gallery image. + * + * @summary the operation to delete a marketplace gallery image. + * x-ms-original-file: 2025-06-01-preview/MarketplaceGalleryImages_Delete.json + */ +async function deleteMarketplaceGalleryImage() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + await client.marketplaceGalleryImages.delete("test-rg", "test-marketplace-gallery-image"); +} + +async function main() { + await deleteMarketplaceGalleryImage(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/marketplaceGalleryImagesGetSample.js b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/marketplaceGalleryImagesGetSample.js new file mode 100644 index 000000000000..6ac35e9ebbda --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/marketplaceGalleryImagesGetSample.js @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { AzureStackHCIVMManagementClient } = require("@azure/arm-azurestackhcivm"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to gets a marketplace gallery image + * + * @summary gets a marketplace gallery image + * x-ms-original-file: 2025-06-01-preview/MarketplaceGalleryImages_Get.json + */ +async function getMarketplaceGalleryImage() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + const result = await client.marketplaceGalleryImages.get( + "test-rg", + "test-marketplace-gallery-image", + ); + console.log(result); +} + +async function main() { + await getMarketplaceGalleryImage(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/marketplaceGalleryImagesListAllSample.js b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/marketplaceGalleryImagesListAllSample.js new file mode 100644 index 000000000000..3072904a2c8f --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/marketplaceGalleryImagesListAllSample.js @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { AzureStackHCIVMManagementClient } = require("@azure/arm-azurestackhcivm"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to lists all of the marketplace gallery images in the specified subscription. Use the nextLink property in the response to get the next page of marketplace gallery images. + * + * @summary lists all of the marketplace gallery images in the specified subscription. Use the nextLink property in the response to get the next page of marketplace gallery images. + * x-ms-original-file: 2025-06-01-preview/MarketplaceGalleryImages_ListAll.json + */ +async function listMarketplaceGalleryImageBySubscription() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.marketplaceGalleryImages.listAll()) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main() { + await listMarketplaceGalleryImageBySubscription(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/marketplaceGalleryImagesListByResourceGroupSample.js b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/marketplaceGalleryImagesListByResourceGroupSample.js new file mode 100644 index 000000000000..3dc630854c76 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/marketplaceGalleryImagesListByResourceGroupSample.js @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { AzureStackHCIVMManagementClient } = require("@azure/arm-azurestackhcivm"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to lists all of the marketplace gallery images in the specified resource group. Use the nextLink property in the response to get the next page of marketplace gallery images. + * + * @summary lists all of the marketplace gallery images in the specified resource group. Use the nextLink property in the response to get the next page of marketplace gallery images. + * x-ms-original-file: 2025-06-01-preview/MarketplaceGalleryImages_ListByResourceGroup.json + */ +async function listMarketplaceGalleryImageByResourceGroup() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.marketplaceGalleryImages.listByResourceGroup("test-rg")) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main() { + await listMarketplaceGalleryImageByResourceGroup(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/marketplaceGalleryImagesUpdateSample.js b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/marketplaceGalleryImagesUpdateSample.js new file mode 100644 index 000000000000..f5c77e205594 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/marketplaceGalleryImagesUpdateSample.js @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { AzureStackHCIVMManagementClient } = require("@azure/arm-azurestackhcivm"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to the operation to update a marketplace gallery image. + * + * @summary the operation to update a marketplace gallery image. + * x-ms-original-file: 2025-06-01-preview/MarketplaceGalleryImages_Update.json + */ +async function updateMarketplaceGalleryImage() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + const result = await client.marketplaceGalleryImages.update( + "test-rg", + "test-marketplce-gallery-image", + { tags: { additionalProperties: "sample" } }, + ); + console.log(result); +} + +async function main() { + await updateMarketplaceGalleryImage(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/networkInterfacesCreateOrUpdateSample.js b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/networkInterfacesCreateOrUpdateSample.js new file mode 100644 index 000000000000..b123034ffd28 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/networkInterfacesCreateOrUpdateSample.js @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { AzureStackHCIVMManagementClient } = require("@azure/arm-azurestackhcivm"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to the operation to create or update a network interface. Please note some properties can be set only during network interface creation. + * + * @summary the operation to create or update a network interface. Please note some properties can be set only during network interface creation. + * x-ms-original-file: 2025-06-01-preview/NetworkInterfaces_CreateOrUpdate.json + */ +async function putNetworkInterface() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + const result = await client.networkInterfaces.createOrUpdate("test-rg", "test-nic", { + extendedLocation: { + name: "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location", + type: "CustomLocation", + }, + location: "eastus", + properties: { + ipConfigurations: [ + { + name: "ipconfig-sample", + properties: { + subnet: { + id: "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/logicalNetworks/test-lnet", + }, + }, + }, + ], + }, + }); + console.log(result); +} + +/** + * This sample demonstrates how to the operation to create or update a network interface. Please note some properties can be set only during network interface creation. + * + * @summary the operation to create or update a network interface. Please note some properties can be set only during network interface creation. + * x-ms-original-file: 2025-06-01-preview/NetworkInterfaces__CreateOrUpdate_CreateFromLocal.json + */ +async function createNetworkInterfaceFromLocal() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + const result = await client.networkInterfaces.createOrUpdate("test-rg", "test-nic", { + extendedLocation: { + name: "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location", + type: "CustomLocation", + }, + location: "eastus", + properties: { + ipConfigurations: [ + { + name: "ipconfig-sample", + properties: { + subnet: { + id: "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/logicalNetworks/test-lnet", + }, + }, + }, + ], + createFromLocal: true, + }, + }); + console.log(result); +} + +async function main() { + await putNetworkInterface(); + await createNetworkInterfaceFromLocal(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/networkInterfacesDeleteSample.js b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/networkInterfacesDeleteSample.js new file mode 100644 index 000000000000..bfca0a5afe57 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/networkInterfacesDeleteSample.js @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { AzureStackHCIVMManagementClient } = require("@azure/arm-azurestackhcivm"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to the operation to delete a network interface. + * + * @summary the operation to delete a network interface. + * x-ms-original-file: 2025-06-01-preview/NetworkInterfaces_Delete.json + */ +async function deleteNetworkInterface() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + await client.networkInterfaces.delete("test-rg", "test-nic"); +} + +async function main() { + await deleteNetworkInterface(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/networkInterfacesGetSample.js b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/networkInterfacesGetSample.js new file mode 100644 index 000000000000..4cf23fe695a6 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/networkInterfacesGetSample.js @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { AzureStackHCIVMManagementClient } = require("@azure/arm-azurestackhcivm"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to gets a network interface + * + * @summary gets a network interface + * x-ms-original-file: 2025-06-01-preview/NetworkInterfaces_Get.json + */ +async function getNetworkInterface() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + const result = await client.networkInterfaces.get("test-rg", "test-nic"); + console.log(result); +} + +async function main() { + await getNetworkInterface(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/networkInterfacesListAllSample.js b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/networkInterfacesListAllSample.js new file mode 100644 index 000000000000..ee748293bc12 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/networkInterfacesListAllSample.js @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { AzureStackHCIVMManagementClient } = require("@azure/arm-azurestackhcivm"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to lists all of the network interfaces in the specified subscription. Use the nextLink property in the response to get the next page of network interfaces. + * + * @summary lists all of the network interfaces in the specified subscription. Use the nextLink property in the response to get the next page of network interfaces. + * x-ms-original-file: 2025-06-01-preview/NetworkInterfaces_ListAll.json + */ +async function listNetworkInterfaceBySubscription() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.networkInterfaces.listAll()) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main() { + await listNetworkInterfaceBySubscription(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/networkInterfacesListByResourceGroupSample.js b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/networkInterfacesListByResourceGroupSample.js new file mode 100644 index 000000000000..0cd5c463430f --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/networkInterfacesListByResourceGroupSample.js @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { AzureStackHCIVMManagementClient } = require("@azure/arm-azurestackhcivm"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to lists all of the network interfaces in the specified resource group. Use the nextLink property in the response to get the next page of network interfaces. + * + * @summary lists all of the network interfaces in the specified resource group. Use the nextLink property in the response to get the next page of network interfaces. + * x-ms-original-file: 2025-06-01-preview/NetworkInterfaces_ListByResourceGroup.json + */ +async function listNetworkInterfaceByResourceGroup() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.networkInterfaces.listByResourceGroup("test-rg")) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main() { + await listNetworkInterfaceByResourceGroup(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/networkInterfacesUpdateSample.js b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/networkInterfacesUpdateSample.js new file mode 100644 index 000000000000..439e4eba5f0e --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/networkInterfacesUpdateSample.js @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { AzureStackHCIVMManagementClient } = require("@azure/arm-azurestackhcivm"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to the operation to update a network interface. + * + * @summary the operation to update a network interface. + * x-ms-original-file: 2025-06-01-preview/NetworkInterfaces_Update.json + */ +async function updateNetworkInterface() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + const result = await client.networkInterfaces.update("test-rg", "test-nic", { + tags: { additionalProperties: "sample" }, + }); + console.log(result); +} + +async function main() { + await updateNetworkInterface(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/networkSecurityGroupsCreateOrUpdateSample.js b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/networkSecurityGroupsCreateOrUpdateSample.js new file mode 100644 index 000000000000..857f00ddef38 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/networkSecurityGroupsCreateOrUpdateSample.js @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { AzureStackHCIVMManagementClient } = require("@azure/arm-azurestackhcivm"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to creates or updates a network security group in the specified resource group. + * + * @summary creates or updates a network security group in the specified resource group. + * x-ms-original-file: 2025-06-01-preview/NetworkSecurityGroups_CreateOrUpdate.json + */ +async function createNetworkSecurityGroup() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + const result = await client.networkSecurityGroups.createOrUpdate("testrg", "testnsg", { + location: "eastus", + }); + console.log(result); +} + +async function main() { + await createNetworkSecurityGroup(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/networkSecurityGroupsDeleteSample.js b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/networkSecurityGroupsDeleteSample.js new file mode 100644 index 000000000000..d51f87e1c244 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/networkSecurityGroupsDeleteSample.js @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { AzureStackHCIVMManagementClient } = require("@azure/arm-azurestackhcivm"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to deletes the specified network security group. + * + * @summary deletes the specified network security group. + * x-ms-original-file: 2025-06-01-preview/NetworkSecurityGroups_Delete.json + */ +async function deleteNetworkSecurityGroup() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + await client.networkSecurityGroups.delete("test-rg", "testnsg"); +} + +async function main() { + await deleteNetworkSecurityGroup(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/networkSecurityGroupsGetSample.js b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/networkSecurityGroupsGetSample.js new file mode 100644 index 000000000000..9a138f990e89 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/networkSecurityGroupsGetSample.js @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { AzureStackHCIVMManagementClient } = require("@azure/arm-azurestackhcivm"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to gets the specified network security group. + * + * @summary gets the specified network security group. + * x-ms-original-file: 2025-06-01-preview/NetworkSecurityGroups_Get.json + */ +async function getNetworkSecurityGroup() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + const result = await client.networkSecurityGroups.get("test-rg", "testnsg"); + console.log(result); +} + +async function main() { + await getNetworkSecurityGroup(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/networkSecurityGroupsListAllSample.js b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/networkSecurityGroupsListAllSample.js new file mode 100644 index 000000000000..8f2e26e3174c --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/networkSecurityGroupsListAllSample.js @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { AzureStackHCIVMManagementClient } = require("@azure/arm-azurestackhcivm"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to gets all network security groups in a subscription. + * + * @summary gets all network security groups in a subscription. + * x-ms-original-file: 2025-06-01-preview/NetworkSecurityGroups_ListAll.json + */ +async function listAllNetworkSecurityGroups() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.networkSecurityGroups.listAll()) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main() { + await listAllNetworkSecurityGroups(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/networkSecurityGroupsListByResourceGroupSample.js b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/networkSecurityGroupsListByResourceGroupSample.js new file mode 100644 index 000000000000..06851b311fbb --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/networkSecurityGroupsListByResourceGroupSample.js @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { AzureStackHCIVMManagementClient } = require("@azure/arm-azurestackhcivm"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to gets all network security groups in a resource group. + * + * @summary gets all network security groups in a resource group. + * x-ms-original-file: 2025-06-01-preview/NetworkSecurityGroups_ListByResourceGroup.json + */ +async function listNetworkSecurityGroupsInResourceGroup() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.networkSecurityGroups.listByResourceGroup("testrg")) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main() { + await listNetworkSecurityGroupsInResourceGroup(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/networkSecurityGroupsUpdateTagsSample.js b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/networkSecurityGroupsUpdateTagsSample.js new file mode 100644 index 000000000000..80e02d8ddfa9 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/networkSecurityGroupsUpdateTagsSample.js @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { AzureStackHCIVMManagementClient } = require("@azure/arm-azurestackhcivm"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to updates a network security group tags. + * + * @summary updates a network security group tags. + * x-ms-original-file: 2025-06-01-preview/NetworkSecurityGroups_UpdateTags.json + */ +async function updateNetworkSecurityGroupTags() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + const result = await client.networkSecurityGroups.updateTags("testrg", "testnsg", { + tags: { tag1: "value1", tag2: "value2" }, + }); + console.log(result); +} + +async function main() { + await updateNetworkSecurityGroupTags(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/package.json b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/package.json new file mode 100644 index 000000000000..d19c1c540974 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/package.json @@ -0,0 +1,33 @@ +{ + "name": "@azure-samples/arm-azurestackhcivm-js-beta", + "private": true, + "version": "1.0.0", + "description": "@azure/arm-azurestackhcivm client library samples for JavaScript (Beta)", + "engines": { + "node": ">=20.0.0" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/Azure/azure-sdk-for-js.git", + "directory": "sdk/azurestackhcivm/arm-azurestackhcivm" + }, + "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/azurestackhcivm/arm-azurestackhcivm", + "dependencies": { + "@azure/arm-azurestackhcivm": "next", + "dotenv": "latest", + "@azure/identity": "^4.9.0" + } +} diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/sample.env b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/sample.env new file mode 100644 index 000000000000..508439fc7d62 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/sample.env @@ -0,0 +1 @@ +# Feel free to add your own environment variables. \ No newline at end of file diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/securityRulesCreateOrUpdateSample.js b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/securityRulesCreateOrUpdateSample.js new file mode 100644 index 000000000000..d591e1a4df13 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/securityRulesCreateOrUpdateSample.js @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { AzureStackHCIVMManagementClient } = require("@azure/arm-azurestackhcivm"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to creates or updates a security rule in the specified resource group. + * + * @summary creates or updates a security rule in the specified resource group. + * x-ms-original-file: 2025-06-01-preview/SecurityRules_CreateOrUpdate.json + */ +async function securityRulesCreateOrUpdate() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + const result = await client.securityRules.createOrUpdate("testrg", "testnsg", "rule1", { + extendedLocation: { + name: "/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location", + type: "CustomLocation", + }, + properties: { + access: "Allow", + destinationAddressPrefixes: ["*"], + destinationPortRanges: ["80"], + direction: "Inbound", + priority: 130, + sourceAddressPrefixes: ["*"], + sourcePortRanges: ["*"], + protocol: "*", + }, + }); + console.log(result); +} + +async function main() { + await securityRulesCreateOrUpdate(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/securityRulesDeleteSample.js b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/securityRulesDeleteSample.js new file mode 100644 index 000000000000..5d418aa6d74a --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/securityRulesDeleteSample.js @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { AzureStackHCIVMManagementClient } = require("@azure/arm-azurestackhcivm"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to deletes the specified security rule. + * + * @summary deletes the specified security rule. + * x-ms-original-file: 2025-06-01-preview/SecurityRules_Delete.json + */ +async function securityRulesDelete() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + await client.securityRules.delete("testrg", "testnsg", "rule1"); +} + +async function main() { + await securityRulesDelete(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/securityRulesGetSample.js b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/securityRulesGetSample.js new file mode 100644 index 000000000000..72a31f352713 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/securityRulesGetSample.js @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { AzureStackHCIVMManagementClient } = require("@azure/arm-azurestackhcivm"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to gets the specified security rule. + * + * @summary gets the specified security rule. + * x-ms-original-file: 2025-06-01-preview/SecurityRules_Get.json + */ +async function getNetworkSecurityRuleInNetworkSecurityGroup() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + const result = await client.securityRules.get("testrg", "testnsg", "rule1"); + console.log(result); +} + +async function main() { + await getNetworkSecurityRuleInNetworkSecurityGroup(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/securityRulesListByNetworkSecurityGroupSample.js b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/securityRulesListByNetworkSecurityGroupSample.js new file mode 100644 index 000000000000..3017380b8172 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/securityRulesListByNetworkSecurityGroupSample.js @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { AzureStackHCIVMManagementClient } = require("@azure/arm-azurestackhcivm"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to gets all security rules in a Network Security Group. + * + * @summary gets all security rules in a Network Security Group. + * x-ms-original-file: 2025-06-01-preview/SecurityRules_ListByNetworkSecurityGroup.json + */ +async function listNetworkSecurityRulesInNetworkSecurityGroup() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.securityRules.listByNetworkSecurityGroup("testrg", "testnsg")) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main() { + await listNetworkSecurityRulesInNetworkSecurityGroup(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/storageContainersCreateOrUpdateSample.js b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/storageContainersCreateOrUpdateSample.js new file mode 100644 index 000000000000..397e7215aa00 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/storageContainersCreateOrUpdateSample.js @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { AzureStackHCIVMManagementClient } = require("@azure/arm-azurestackhcivm"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to the operation to create or update a storage container. Please note some properties can be set only during storage container creation. + * + * @summary the operation to create or update a storage container. Please note some properties can be set only during storage container creation. + * x-ms-original-file: 2025-06-01-preview/StorageContainers_CreateOrUpdate.json + */ +async function putStorageContainer() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + const result = await client.storageContainers.createOrUpdate("test-rg", "Default_Container", { + extendedLocation: { + name: "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location", + type: "CustomLocation", + }, + location: "West US2", + properties: { path: "C:\\container_storage" }, + }); + console.log(result); +} + +async function main() { + await putStorageContainer(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/storageContainersDeleteSample.js b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/storageContainersDeleteSample.js new file mode 100644 index 000000000000..907223a43a5c --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/storageContainersDeleteSample.js @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { AzureStackHCIVMManagementClient } = require("@azure/arm-azurestackhcivm"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to the operation to delete a storage container. + * + * @summary the operation to delete a storage container. + * x-ms-original-file: 2025-06-01-preview/StorageContainers_Delete.json + */ +async function deleteStorageContainer() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + await client.storageContainers.delete("test-rg", "Default_Container"); +} + +async function main() { + await deleteStorageContainer(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/storageContainersGetSample.js b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/storageContainersGetSample.js new file mode 100644 index 000000000000..91b5c95e9445 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/storageContainersGetSample.js @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { AzureStackHCIVMManagementClient } = require("@azure/arm-azurestackhcivm"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to gets a storage container + * + * @summary gets a storage container + * x-ms-original-file: 2025-06-01-preview/StorageContainers_Get.json + */ +async function getStorageContainer() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + const result = await client.storageContainers.get("test-rg", "Default_Container"); + console.log(result); +} + +async function main() { + await getStorageContainer(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/storageContainersListAllSample.js b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/storageContainersListAllSample.js new file mode 100644 index 000000000000..b7fc5f70aa05 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/storageContainersListAllSample.js @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { AzureStackHCIVMManagementClient } = require("@azure/arm-azurestackhcivm"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to lists all of the storage containers in the specified subscription. Use the nextLink property in the response to get the next page of storage containers. + * + * @summary lists all of the storage containers in the specified subscription. Use the nextLink property in the response to get the next page of storage containers. + * x-ms-original-file: 2025-06-01-preview/StorageContainers_ListAll.json + */ +async function listStorageContainerBySubscription() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.storageContainers.listAll()) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main() { + await listStorageContainerBySubscription(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/storageContainersListByResourceGroupSample.js b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/storageContainersListByResourceGroupSample.js new file mode 100644 index 000000000000..00166d764961 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/storageContainersListByResourceGroupSample.js @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { AzureStackHCIVMManagementClient } = require("@azure/arm-azurestackhcivm"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to lists all of the storage containers in the specified resource group. Use the nextLink property in the response to get the next page of storage containers. + * + * @summary lists all of the storage containers in the specified resource group. Use the nextLink property in the response to get the next page of storage containers. + * x-ms-original-file: 2025-06-01-preview/StorageContainers_ListByResourceGroup.json + */ +async function listStorageContainerByResourceGroup() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.storageContainers.listByResourceGroup("test-rg")) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main() { + await listStorageContainerByResourceGroup(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/storageContainersUpdateSample.js b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/storageContainersUpdateSample.js new file mode 100644 index 000000000000..6eb1b7ae1a12 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/storageContainersUpdateSample.js @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { AzureStackHCIVMManagementClient } = require("@azure/arm-azurestackhcivm"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to the operation to update a storage container. + * + * @summary the operation to update a storage container. + * x-ms-original-file: 2025-06-01-preview/StorageContainers_Update.json + */ +async function updateStorageContainer() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + const result = await client.storageContainers.update("test-rg", "Default_Container", { + tags: { additionalProperties: "sample" }, + }); + console.log(result); +} + +async function main() { + await updateStorageContainer(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/virtualHardDisksCreateOrUpdateSample.js b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/virtualHardDisksCreateOrUpdateSample.js new file mode 100644 index 000000000000..f14e91414df3 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/virtualHardDisksCreateOrUpdateSample.js @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { AzureStackHCIVMManagementClient } = require("@azure/arm-azurestackhcivm"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to the operation to create or update a virtual hard disk. Please note some properties can be set only during virtual hard disk creation. + * + * @summary the operation to create or update a virtual hard disk. Please note some properties can be set only during virtual hard disk creation. + * x-ms-original-file: 2025-06-01-preview/VirtualHardDisks_CreateOrUpdate.json + */ +async function putVirtualHardDisk() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + const result = await client.virtualHardDisks.createOrUpdate("test-rg", "test-vhd", { + extendedLocation: { + name: "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location", + type: "CustomLocation", + }, + location: "West US2", + properties: { diskSizeGB: 32 }, + }); + console.log(result); +} + +/** + * This sample demonstrates how to the operation to create or update a virtual hard disk. Please note some properties can be set only during virtual hard disk creation. + * + * @summary the operation to create or update a virtual hard disk. Please note some properties can be set only during virtual hard disk creation. + * x-ms-original-file: 2025-06-01-preview/VirtualHardDisks__CreateOrUpdate_CreateFromLocal.json + */ +async function createVirtualHardDiskFromLocal() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + const result = await client.virtualHardDisks.createOrUpdate("test-rg", "test-vhd", { + extendedLocation: { + name: "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location", + type: "CustomLocation", + }, + location: "West US2", + properties: { + createFromLocal: true, + containerId: + "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/storageContainers/test-storage-container", + }, + }); + console.log(result); +} + +async function main() { + await putVirtualHardDisk(); + await createVirtualHardDiskFromLocal(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/virtualHardDisksDeleteSample.js b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/virtualHardDisksDeleteSample.js new file mode 100644 index 000000000000..0916e922fee8 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/virtualHardDisksDeleteSample.js @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { AzureStackHCIVMManagementClient } = require("@azure/arm-azurestackhcivm"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to the operation to delete a virtual hard disk. + * + * @summary the operation to delete a virtual hard disk. + * x-ms-original-file: 2025-06-01-preview/VirtualHardDisks_Delete.json + */ +async function deleteVirtualHardDisk() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + await client.virtualHardDisks.delete("test-rg", "test-vhd"); +} + +async function main() { + await deleteVirtualHardDisk(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/virtualHardDisksGetSample.js b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/virtualHardDisksGetSample.js new file mode 100644 index 000000000000..5f117bd9d7b9 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/virtualHardDisksGetSample.js @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { AzureStackHCIVMManagementClient } = require("@azure/arm-azurestackhcivm"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to gets a virtual hard disk + * + * @summary gets a virtual hard disk + * x-ms-original-file: 2025-06-01-preview/VirtualHardDisks_Get.json + */ +async function getVirtualHardDisk() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + const result = await client.virtualHardDisks.get("test-rg", "test-vhd"); + console.log(result); +} + +async function main() { + await getVirtualHardDisk(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/virtualHardDisksListAllSample.js b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/virtualHardDisksListAllSample.js new file mode 100644 index 000000000000..d5e395d8cd9f --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/virtualHardDisksListAllSample.js @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { AzureStackHCIVMManagementClient } = require("@azure/arm-azurestackhcivm"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to lists all of the virtual hard disks in the specified subscription. Use the nextLink property in the response to get the next page of virtual hard disks. + * + * @summary lists all of the virtual hard disks in the specified subscription. Use the nextLink property in the response to get the next page of virtual hard disks. + * x-ms-original-file: 2025-06-01-preview/VirtualHardDisks_ListAll.json + */ +async function listVirtualHardDiskBySubscription() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.virtualHardDisks.listAll()) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main() { + await listVirtualHardDiskBySubscription(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/virtualHardDisksListByResourceGroupSample.js b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/virtualHardDisksListByResourceGroupSample.js new file mode 100644 index 000000000000..7f1ca0802057 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/virtualHardDisksListByResourceGroupSample.js @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { AzureStackHCIVMManagementClient } = require("@azure/arm-azurestackhcivm"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to lists all of the virtual hard disks in the specified resource group. Use the nextLink property in the response to get the next page of virtual hard disks. + * + * @summary lists all of the virtual hard disks in the specified resource group. Use the nextLink property in the response to get the next page of virtual hard disks. + * x-ms-original-file: 2025-06-01-preview/VirtualHardDisks_ListByResourceGroup.json + */ +async function listVirtualHardDiskByResourceGroup() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.virtualHardDisks.listByResourceGroup("test-rg")) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main() { + await listVirtualHardDiskByResourceGroup(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/virtualHardDisksUpdateSample.js b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/virtualHardDisksUpdateSample.js new file mode 100644 index 000000000000..f3e79b088942 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/virtualHardDisksUpdateSample.js @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { AzureStackHCIVMManagementClient } = require("@azure/arm-azurestackhcivm"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to the operation to update a virtual hard disk. + * + * @summary the operation to update a virtual hard disk. + * x-ms-original-file: 2025-06-01-preview/VirtualHardDisks_Update.json + */ +async function updateVirtualHardDisk() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + const result = await client.virtualHardDisks.update("test-rg", "test-vhd", { + tags: { additionalProperties: "sample" }, + }); + console.log(result); +} + +async function main() { + await updateVirtualHardDisk(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/virtualHardDisksUploadSample.js b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/virtualHardDisksUploadSample.js new file mode 100644 index 000000000000..6d75d492fcba --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/virtualHardDisksUploadSample.js @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { AzureStackHCIVMManagementClient } = require("@azure/arm-azurestackhcivm"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to the operation to upload a virtual hard disk. + * + * @summary the operation to upload a virtual hard disk. + * x-ms-original-file: 2025-06-01-preview/VirtualHardDisks_Upload.json + */ +async function uploadVirtualHardDisk() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + const result = await client.virtualHardDisks.upload("test-rg", "test-vhd", { + azureManagedDiskUploadUrl: + "https://YourStorageAccountName.blob.core.windows.net/YourContainerName/YourVHDBlobName.vhd?", + }); + console.log(result); +} + +async function main() { + await uploadVirtualHardDisk(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/virtualMachineInstancesCreateOrUpdateSample.js b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/virtualMachineInstancesCreateOrUpdateSample.js new file mode 100644 index 000000000000..0806f3b3e0af --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/virtualMachineInstancesCreateOrUpdateSample.js @@ -0,0 +1,294 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { AzureStackHCIVMManagementClient } = require("@azure/arm-azurestackhcivm"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to the operation to create or update a virtual machine instance. Please note some properties can be set only during virtual machine instance creation. + * + * @summary the operation to create or update a virtual machine instance. Please note some properties can be set only during virtual machine instance creation. + * x-ms-original-file: 2025-06-01-preview/VirtualMachineInstances_CreateOrUpdate_Put_Virtual_Machine_Instance_With_Gallery_Image.json + */ +async function putVirtualMachineInstanceWithGalleryImage() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-00000000000"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + const result = await client.virtualMachineInstances.createOrUpdate( + "subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.HybridCompute/machines/DemoVM", + { + extendedLocation: { + name: "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location", + type: "CustomLocation", + }, + properties: { + hardwareProfile: { vmSize: "Default" }, + networkProfile: { + networkInterfaces: [ + { + id: "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/networkInterfaces/test-nic", + }, + ], + }, + osProfile: { + adminPassword: "password", + adminUsername: "localadmin", + computerName: "luamaster", + }, + securityProfile: { + enableTPM: true, + uefiSettings: { secureBootEnabled: true }, + }, + storageProfile: { + imageReference: { + id: "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/galleryImages/test-gallery-image", + }, + vmConfigStoragePathId: + "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/storageContainers/test-container", + }, + }, + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to the operation to create or update a virtual machine instance. Please note some properties can be set only during virtual machine instance creation. + * + * @summary the operation to create or update a virtual machine instance. Please note some properties can be set only during virtual machine instance creation. + * x-ms-original-file: 2025-06-01-preview/VirtualMachineInstances_CreateOrUpdate_Put_Virtual_Machine_Instance_With_Gpu.json + */ +async function putVirtualMachineInstanceWithGpu() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-00000000000"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + const result = await client.virtualMachineInstances.createOrUpdate( + "subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.HybridCompute/machines/DemoVM", + { + extendedLocation: { + name: "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location", + type: "CustomLocation", + }, + properties: { + hardwareProfile: { + vmSize: "Default", + virtualMachineGPUs: [{ assignmentType: "GpuDDA", partitionSizeMB: 0 }], + }, + networkProfile: { + networkInterfaces: [ + { + id: "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/networkInterfaces/test-nic", + }, + ], + }, + osProfile: { + adminPassword: "password", + adminUsername: "localadmin", + computerName: "luamaster", + }, + securityProfile: { + enableTPM: true, + uefiSettings: { secureBootEnabled: true }, + }, + storageProfile: { + imageReference: { + id: "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/galleryImages/test-gallery-image", + }, + vmConfigStoragePathId: + "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/storageContainers/test-container", + }, + }, + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to the operation to create or update a virtual machine instance. Please note some properties can be set only during virtual machine instance creation. + * + * @summary the operation to create or update a virtual machine instance. Please note some properties can be set only during virtual machine instance creation. + * x-ms-original-file: 2025-06-01-preview/VirtualMachineInstances_CreateOrUpdate_Put_Virtual_Machine_Instance_With_Marketplace_Gallery_Image.json + */ +async function putVirtualMachineInstanceWithMarketplaceGalleryImage() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-00000000000"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + const result = await client.virtualMachineInstances.createOrUpdate( + "subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.HybridCompute/machines/DemoVM", + { + extendedLocation: { + name: "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location", + type: "CustomLocation", + }, + properties: { + hardwareProfile: { vmSize: "Default" }, + networkProfile: { + networkInterfaces: [ + { + id: "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/networkInterfaces/test-nic", + }, + ], + }, + osProfile: { + adminPassword: "password", + adminUsername: "localadmin", + computerName: "luamaster", + }, + securityProfile: { + enableTPM: true, + uefiSettings: { secureBootEnabled: true }, + }, + storageProfile: { + imageReference: { + id: "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/marketplaceGalleryImages/test-marketplace-gallery-image", + }, + vmConfigStoragePathId: + "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/storageContainers/test-container", + }, + }, + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to the operation to create or update a virtual machine instance. Please note some properties can be set only during virtual machine instance creation. + * + * @summary the operation to create or update a virtual machine instance. Please note some properties can be set only during virtual machine instance creation. + * x-ms-original-file: 2025-06-01-preview/VirtualMachineInstances_CreateOrUpdate_Put_Virtual_Machine_Instance_With_Os_Disk.json + */ +async function putVirtualMachineInstanceWithOsDisk() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-00000000000"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + const result = await client.virtualMachineInstances.createOrUpdate( + "subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.HybridCompute/machines/DemoVM", + { + extendedLocation: { + name: "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location", + type: "CustomLocation", + }, + properties: { + hardwareProfile: { vmSize: "Default" }, + networkProfile: { + networkInterfaces: [ + { + id: "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/networkInterfaces/test-nic", + }, + ], + }, + securityProfile: { + enableTPM: true, + uefiSettings: { secureBootEnabled: true }, + }, + storageProfile: { + osDisk: { + id: "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/virtualHardDisks/test-vhd", + }, + vmConfigStoragePathId: + "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/storageContainers/test-container", + }, + }, + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to the operation to create or update a virtual machine instance. Please note some properties can be set only during virtual machine instance creation. + * + * @summary the operation to create or update a virtual machine instance. Please note some properties can be set only during virtual machine instance creation. + * x-ms-original-file: 2025-06-01-preview/VirtualMachineInstances_CreateOrUpdate_Put_Virtual_Machine_Instance_With_Vm_Config_Agent.json + */ +async function putVirtualMachineInstanceWithVMConfigAgent() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-00000000000"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + const result = await client.virtualMachineInstances.createOrUpdate( + "subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.HybridCompute/machines/DemoVM", + { + extendedLocation: { + name: "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location", + type: "CustomLocation", + }, + properties: { + hardwareProfile: { vmSize: "Default" }, + networkProfile: { + networkInterfaces: [ + { + id: "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/networkInterfaces/test-nic", + }, + ], + }, + osProfile: { + adminPassword: "password", + adminUsername: "localadmin", + computerName: "luamaster", + windowsConfiguration: { provisionVMConfigAgent: true }, + }, + securityProfile: { + enableTPM: true, + uefiSettings: { secureBootEnabled: true }, + }, + storageProfile: { + imageReference: { + id: "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/galleryImages/test-gallery-image", + }, + vmConfigStoragePathId: + "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/storageContainers/test-container", + }, + }, + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to the operation to create or update a virtual machine instance. Please note some properties can be set only during virtual machine instance creation. + * + * @summary the operation to create or update a virtual machine instance. Please note some properties can be set only during virtual machine instance creation. + * x-ms-original-file: 2025-06-01-preview/VirtualMachineInstances__CreateOrUpdate_CreateFromLocal.json + */ +async function createVirtualMachineInstanceFromLocal() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-00000000000"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + const result = await client.virtualMachineInstances.createOrUpdate( + "subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.HybridCompute/machines/DemoVM", + { + extendedLocation: { + name: "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location", + type: "CustomLocation", + }, + properties: { + networkProfile: { + networkInterfaces: [ + { + id: "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/networkInterfaces/test-nic", + }, + ], + }, + storageProfile: { + dataDisks: [ + { + id: "/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.AzureStackHCI/virtualHardDisks/test-vhd", + }, + ], + }, + createFromLocal: true, + }, + }, + ); + console.log(result); +} + +async function main() { + await putVirtualMachineInstanceWithGalleryImage(); + await putVirtualMachineInstanceWithGpu(); + await putVirtualMachineInstanceWithMarketplaceGalleryImage(); + await putVirtualMachineInstanceWithOsDisk(); + await putVirtualMachineInstanceWithVMConfigAgent(); + await createVirtualMachineInstanceFromLocal(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/virtualMachineInstancesDeleteSample.js b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/virtualMachineInstancesDeleteSample.js new file mode 100644 index 000000000000..fee04988be19 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/virtualMachineInstancesDeleteSample.js @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { AzureStackHCIVMManagementClient } = require("@azure/arm-azurestackhcivm"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to the operation to delete a virtual machine instance. + * + * @summary the operation to delete a virtual machine instance. + * x-ms-original-file: 2025-06-01-preview/VirtualMachineInstances_Delete.json + */ +async function deleteVirtualMachine() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-00000000000"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + await client.virtualMachineInstances.delete( + "subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.HybridCompute/machines/DemoVM", + ); +} + +async function main() { + await deleteVirtualMachine(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/virtualMachineInstancesGetSample.js b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/virtualMachineInstancesGetSample.js new file mode 100644 index 000000000000..cf2e355456f6 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/virtualMachineInstancesGetSample.js @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { AzureStackHCIVMManagementClient } = require("@azure/arm-azurestackhcivm"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to gets a virtual machine instance + * + * @summary gets a virtual machine instance + * x-ms-original-file: 2025-06-01-preview/VirtualMachineInstances_Get.json + */ +async function getVirtualMachineInstance() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-00000000000"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + const result = await client.virtualMachineInstances.get( + "subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.HybridCompute/machines/DemoVM", + ); + console.log(result); +} + +async function main() { + await getVirtualMachineInstance(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/virtualMachineInstancesListSample.js b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/virtualMachineInstancesListSample.js new file mode 100644 index 000000000000..6f0decac2d94 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/virtualMachineInstancesListSample.js @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { AzureStackHCIVMManagementClient } = require("@azure/arm-azurestackhcivm"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to lists all of the virtual machine instances within the specified parent resource. + * + * @summary lists all of the virtual machine instances within the specified parent resource. + * x-ms-original-file: 2025-06-01-preview/VirtualMachineInstances_List.json + */ +async function listVirtualMachineInstances() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-00000000000"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.virtualMachineInstances.list( + "subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.HybridCompute/machines/DemoVM", + )) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main() { + await listVirtualMachineInstances(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/virtualMachineInstancesPauseSample.js b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/virtualMachineInstancesPauseSample.js new file mode 100644 index 000000000000..076bdaecc6a9 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/virtualMachineInstancesPauseSample.js @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { AzureStackHCIVMManagementClient } = require("@azure/arm-azurestackhcivm"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to the operation to pause a virtual machine instance. + * + * @summary the operation to pause a virtual machine instance. + * x-ms-original-file: 2025-06-01-preview/VirtualMachineInstances_Pause.json + */ +async function pauseVirtualMachine() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-00000000000"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + await client.virtualMachineInstances.pause( + "subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/Microsoft.HybridCompute/machines/DemoVM/providers/Microsoft.AzureStackHCI/virtualMachineInstances/default", + ); +} + +async function main() { + await pauseVirtualMachine(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/virtualMachineInstancesRestartSample.js b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/virtualMachineInstancesRestartSample.js new file mode 100644 index 000000000000..480e4a642f40 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/virtualMachineInstancesRestartSample.js @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { AzureStackHCIVMManagementClient } = require("@azure/arm-azurestackhcivm"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to the operation to restart a virtual machine instance. + * + * @summary the operation to restart a virtual machine instance. + * x-ms-original-file: 2025-06-01-preview/VirtualMachineInstances_Restart.json + */ +async function restartVirtualMachine() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-00000000000"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + await client.virtualMachineInstances.restart( + "subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.HybridCompute/machines/DemoVM/providers/Microsoft.AzureStackHCI/virtualMachineInstances/default", + ); +} + +async function main() { + await restartVirtualMachine(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/virtualMachineInstancesSaveSample.js b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/virtualMachineInstancesSaveSample.js new file mode 100644 index 000000000000..5ddb1fd53cee --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/virtualMachineInstancesSaveSample.js @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { AzureStackHCIVMManagementClient } = require("@azure/arm-azurestackhcivm"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to the operation to save a virtual machine instance. + * + * @summary the operation to save a virtual machine instance. + * x-ms-original-file: 2025-06-01-preview/VirtualMachineInstances_Save.json + */ +async function saveVirtualMachine() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-00000000000"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + await client.virtualMachineInstances.save( + "subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/Microsoft.HybridCompute/machines/DemoVM/providers/Microsoft.AzureStackHCI/virtualMachineInstances/default", + ); +} + +async function main() { + await saveVirtualMachine(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/virtualMachineInstancesStartSample.js b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/virtualMachineInstancesStartSample.js new file mode 100644 index 000000000000..be09a826a03a --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/virtualMachineInstancesStartSample.js @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { AzureStackHCIVMManagementClient } = require("@azure/arm-azurestackhcivm"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to the operation to start a virtual machine instance. + * + * @summary the operation to start a virtual machine instance. + * x-ms-original-file: 2025-06-01-preview/VirtualMachineInstances_Start.json + */ +async function startVirtualMachine() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-00000000000"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + await client.virtualMachineInstances.start( + "subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.HybridCompute/machines/DemoVM/providers/Microsoft.AzureStackHCI/virtualMachineInstances/default", + ); +} + +async function main() { + await startVirtualMachine(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/virtualMachineInstancesStopSample.js b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/virtualMachineInstancesStopSample.js new file mode 100644 index 000000000000..2d6e8ac6e309 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/virtualMachineInstancesStopSample.js @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { AzureStackHCIVMManagementClient } = require("@azure/arm-azurestackhcivm"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to the operation to stop a virtual machine instance. + * + * @summary the operation to stop a virtual machine instance. + * x-ms-original-file: 2025-06-01-preview/VirtualMachineInstances_Stop.json + */ +async function stopVirtualMachine() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-00000000000"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + await client.virtualMachineInstances.stop( + "subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.HybridCompute/machines/DemoVM/providers/Microsoft.AzureStackHCI/virtualMachineInstances/default", + ); +} + +async function main() { + await stopVirtualMachine(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/virtualMachineInstancesUpdateSample.js b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/virtualMachineInstancesUpdateSample.js new file mode 100644 index 000000000000..03c104af23ae --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/javascript/virtualMachineInstancesUpdateSample.js @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { AzureStackHCIVMManagementClient } = require("@azure/arm-azurestackhcivm"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to the operation to update a virtual machine instance. + * + * @summary the operation to update a virtual machine instance. + * x-ms-original-file: 2025-06-01-preview/VirtualMachineInstances_Update.json + */ +async function updateVirtualMachine() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-00000000000"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + const result = await client.virtualMachineInstances.update( + "subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.HybridCompute/machines/DemoVM", + { + properties: { + storageProfile: { + dataDisks: [ + { + id: "/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.AzureStackHCI/virtualHardDisks/test-vhd", + }, + ], + }, + }, + }, + ); + console.log(result); +} + +async function main() { + await updateVirtualMachine(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/README.md b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/README.md new file mode 100644 index 000000000000..4cce3085b275 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/README.md @@ -0,0 +1,189 @@ +# @azure/arm-azurestackhcivm client library samples for TypeScript (Beta) + +These sample programs show how to use the TypeScript client libraries for @azure/arm-azurestackhcivm in some common scenarios. + +| **File Name** | **Description** | +| ----------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| [attestationStatusesGetSample.ts][attestationstatusesgetsample] | implements AttestationStatus GET method. x-ms-original-file: 2025-06-01-preview/AttestationStatuses_Get.json | +| [galleryImagesCreateOrUpdateSample.ts][galleryimagescreateorupdatesample] | the operation to create or update a gallery image. Please note some properties can be set only during gallery image creation. x-ms-original-file: 2025-06-01-preview/GalleryImages_CreateOrUpdate.json | +| [galleryImagesDeleteSample.ts][galleryimagesdeletesample] | the operation to delete a gallery image. x-ms-original-file: 2025-06-01-preview/GalleryImages_Delete.json | +| [galleryImagesGetSample.ts][galleryimagesgetsample] | gets a gallery image x-ms-original-file: 2025-06-01-preview/GalleryImages_Get.json | +| [galleryImagesListAllSample.ts][galleryimageslistallsample] | lists all of the gallery images in the specified subscription. Use the nextLink property in the response to get the next page of gallery images. x-ms-original-file: 2025-06-01-preview/GalleryImages_ListAll.json | +| [galleryImagesListByResourceGroupSample.ts][galleryimageslistbyresourcegroupsample] | lists all of the gallery images in the specified resource group. Use the nextLink property in the response to get the next page of gallery images. x-ms-original-file: 2025-06-01-preview/GalleryImages_ListByResourceGroup.json | +| [galleryImagesUpdateSample.ts][galleryimagesupdatesample] | the operation to update a gallery image. x-ms-original-file: 2025-06-01-preview/GalleryImages_Update.json | +| [guestAgentsCreateSample.ts][guestagentscreatesample] | create Or Update GuestAgent. x-ms-original-file: 2025-06-01-preview/GuestAgents_Create.json | +| [guestAgentsDeleteSample.ts][guestagentsdeletesample] | implements GuestAgent DELETE method. x-ms-original-file: 2025-06-01-preview/GuestAgents_Delete.json | +| [guestAgentsGetSample.ts][guestagentsgetsample] | implements GuestAgent GET method. x-ms-original-file: 2025-06-01-preview/GuestAgents_Get.json | +| [guestAgentsListByVirtualMachineInstanceSample.ts][guestagentslistbyvirtualmachineinstancesample] | returns the list of GuestAgent of the given vm. x-ms-original-file: 2025-06-01-preview/GuestAgents_ListByVirtualMachineInstance.json | +| [hybridIdentityMetadataGetSample.ts][hybrididentitymetadatagetsample] | implements HybridIdentityMetadata GET method. x-ms-original-file: 2025-06-01-preview/HybridIdentityMetadataGroup_Get.json | +| [hybridIdentityMetadataListByVirtualMachineInstanceSample.ts][hybrididentitymetadatalistbyvirtualmachineinstancesample] | returns the list of HybridIdentityMetadata of the given vm. x-ms-original-file: 2025-06-01-preview/HybridIdentityMetadata_ListByVirtualMachineInstance.json | +| [logicalNetworksCreateOrUpdateSample.ts][logicalnetworkscreateorupdatesample] | the operation to create or update a logical network. Please note some properties can be set only during logical network creation. x-ms-original-file: 2025-06-01-preview/LogicalNetworks_CreateOrUpdate.json | +| [logicalNetworksDeleteSample.ts][logicalnetworksdeletesample] | the operation to delete a logical network. x-ms-original-file: 2025-06-01-preview/LogicalNetworks_Delete.json | +| [logicalNetworksGetSample.ts][logicalnetworksgetsample] | the operation to get a logical network. x-ms-original-file: 2025-06-01-preview/LogicalNetworks_Get.json | +| [logicalNetworksListAllSample.ts][logicalnetworkslistallsample] | lists all of the logical networks in the specified subscription. Use the nextLink property in the response to get the next page of logical networks. x-ms-original-file: 2025-06-01-preview/LogicalNetworks_ListAll.json | +| [logicalNetworksListByResourceGroupSample.ts][logicalnetworkslistbyresourcegroupsample] | lists all of the logical networks in the specified resource group. Use the nextLink property in the response to get the next page of logical networks. x-ms-original-file: 2025-06-01-preview/LogicalNetworks_ListByResourceGroup.json | +| [logicalNetworksUpdateSample.ts][logicalnetworksupdatesample] | the operation to update a logical network. x-ms-original-file: 2025-06-01-preview/LogicalNetworks_Update.json | +| [marketplaceGalleryImagesCreateOrUpdateSample.ts][marketplacegalleryimagescreateorupdatesample] | the operation to create or update a marketplace gallery image. Please note some properties can be set only during marketplace gallery image creation. x-ms-original-file: 2025-06-01-preview/MarketplaceGalleryImages_CreateOrUpdate.json | +| [marketplaceGalleryImagesDeleteSample.ts][marketplacegalleryimagesdeletesample] | the operation to delete a marketplace gallery image. x-ms-original-file: 2025-06-01-preview/MarketplaceGalleryImages_Delete.json | +| [marketplaceGalleryImagesGetSample.ts][marketplacegalleryimagesgetsample] | gets a marketplace gallery image x-ms-original-file: 2025-06-01-preview/MarketplaceGalleryImages_Get.json | +| [marketplaceGalleryImagesListAllSample.ts][marketplacegalleryimageslistallsample] | lists all of the marketplace gallery images in the specified subscription. Use the nextLink property in the response to get the next page of marketplace gallery images. x-ms-original-file: 2025-06-01-preview/MarketplaceGalleryImages_ListAll.json | +| [marketplaceGalleryImagesListByResourceGroupSample.ts][marketplacegalleryimageslistbyresourcegroupsample] | lists all of the marketplace gallery images in the specified resource group. Use the nextLink property in the response to get the next page of marketplace gallery images. x-ms-original-file: 2025-06-01-preview/MarketplaceGalleryImages_ListByResourceGroup.json | +| [marketplaceGalleryImagesUpdateSample.ts][marketplacegalleryimagesupdatesample] | the operation to update a marketplace gallery image. x-ms-original-file: 2025-06-01-preview/MarketplaceGalleryImages_Update.json | +| [networkInterfacesCreateOrUpdateSample.ts][networkinterfacescreateorupdatesample] | the operation to create or update a network interface. Please note some properties can be set only during network interface creation. x-ms-original-file: 2025-06-01-preview/NetworkInterfaces_CreateOrUpdate.json | +| [networkInterfacesDeleteSample.ts][networkinterfacesdeletesample] | the operation to delete a network interface. x-ms-original-file: 2025-06-01-preview/NetworkInterfaces_Delete.json | +| [networkInterfacesGetSample.ts][networkinterfacesgetsample] | gets a network interface x-ms-original-file: 2025-06-01-preview/NetworkInterfaces_Get.json | +| [networkInterfacesListAllSample.ts][networkinterfaceslistallsample] | lists all of the network interfaces in the specified subscription. Use the nextLink property in the response to get the next page of network interfaces. x-ms-original-file: 2025-06-01-preview/NetworkInterfaces_ListAll.json | +| [networkInterfacesListByResourceGroupSample.ts][networkinterfaceslistbyresourcegroupsample] | lists all of the network interfaces in the specified resource group. Use the nextLink property in the response to get the next page of network interfaces. x-ms-original-file: 2025-06-01-preview/NetworkInterfaces_ListByResourceGroup.json | +| [networkInterfacesUpdateSample.ts][networkinterfacesupdatesample] | the operation to update a network interface. x-ms-original-file: 2025-06-01-preview/NetworkInterfaces_Update.json | +| [networkSecurityGroupsCreateOrUpdateSample.ts][networksecuritygroupscreateorupdatesample] | creates or updates a network security group in the specified resource group. x-ms-original-file: 2025-06-01-preview/NetworkSecurityGroups_CreateOrUpdate.json | +| [networkSecurityGroupsDeleteSample.ts][networksecuritygroupsdeletesample] | deletes the specified network security group. x-ms-original-file: 2025-06-01-preview/NetworkSecurityGroups_Delete.json | +| [networkSecurityGroupsGetSample.ts][networksecuritygroupsgetsample] | gets the specified network security group. x-ms-original-file: 2025-06-01-preview/NetworkSecurityGroups_Get.json | +| [networkSecurityGroupsListAllSample.ts][networksecuritygroupslistallsample] | gets all network security groups in a subscription. x-ms-original-file: 2025-06-01-preview/NetworkSecurityGroups_ListAll.json | +| [networkSecurityGroupsListByResourceGroupSample.ts][networksecuritygroupslistbyresourcegroupsample] | gets all network security groups in a resource group. x-ms-original-file: 2025-06-01-preview/NetworkSecurityGroups_ListByResourceGroup.json | +| [networkSecurityGroupsUpdateTagsSample.ts][networksecuritygroupsupdatetagssample] | updates a network security group tags. x-ms-original-file: 2025-06-01-preview/NetworkSecurityGroups_UpdateTags.json | +| [securityRulesCreateOrUpdateSample.ts][securityrulescreateorupdatesample] | creates or updates a security rule in the specified resource group. x-ms-original-file: 2025-06-01-preview/SecurityRules_CreateOrUpdate.json | +| [securityRulesDeleteSample.ts][securityrulesdeletesample] | deletes the specified security rule. x-ms-original-file: 2025-06-01-preview/SecurityRules_Delete.json | +| [securityRulesGetSample.ts][securityrulesgetsample] | gets the specified security rule. x-ms-original-file: 2025-06-01-preview/SecurityRules_Get.json | +| [securityRulesListByNetworkSecurityGroupSample.ts][securityruleslistbynetworksecuritygroupsample] | gets all security rules in a Network Security Group. x-ms-original-file: 2025-06-01-preview/SecurityRules_ListByNetworkSecurityGroup.json | +| [storageContainersCreateOrUpdateSample.ts][storagecontainerscreateorupdatesample] | the operation to create or update a storage container. Please note some properties can be set only during storage container creation. x-ms-original-file: 2025-06-01-preview/StorageContainers_CreateOrUpdate.json | +| [storageContainersDeleteSample.ts][storagecontainersdeletesample] | the operation to delete a storage container. x-ms-original-file: 2025-06-01-preview/StorageContainers_Delete.json | +| [storageContainersGetSample.ts][storagecontainersgetsample] | gets a storage container x-ms-original-file: 2025-06-01-preview/StorageContainers_Get.json | +| [storageContainersListAllSample.ts][storagecontainerslistallsample] | lists all of the storage containers in the specified subscription. Use the nextLink property in the response to get the next page of storage containers. x-ms-original-file: 2025-06-01-preview/StorageContainers_ListAll.json | +| [storageContainersListByResourceGroupSample.ts][storagecontainerslistbyresourcegroupsample] | lists all of the storage containers in the specified resource group. Use the nextLink property in the response to get the next page of storage containers. x-ms-original-file: 2025-06-01-preview/StorageContainers_ListByResourceGroup.json | +| [storageContainersUpdateSample.ts][storagecontainersupdatesample] | the operation to update a storage container. x-ms-original-file: 2025-06-01-preview/StorageContainers_Update.json | +| [virtualHardDisksCreateOrUpdateSample.ts][virtualharddiskscreateorupdatesample] | the operation to create or update a virtual hard disk. Please note some properties can be set only during virtual hard disk creation. x-ms-original-file: 2025-06-01-preview/VirtualHardDisks_CreateOrUpdate.json | +| [virtualHardDisksDeleteSample.ts][virtualharddisksdeletesample] | the operation to delete a virtual hard disk. x-ms-original-file: 2025-06-01-preview/VirtualHardDisks_Delete.json | +| [virtualHardDisksGetSample.ts][virtualharddisksgetsample] | gets a virtual hard disk x-ms-original-file: 2025-06-01-preview/VirtualHardDisks_Get.json | +| [virtualHardDisksListAllSample.ts][virtualharddiskslistallsample] | lists all of the virtual hard disks in the specified subscription. Use the nextLink property in the response to get the next page of virtual hard disks. x-ms-original-file: 2025-06-01-preview/VirtualHardDisks_ListAll.json | +| [virtualHardDisksListByResourceGroupSample.ts][virtualharddiskslistbyresourcegroupsample] | lists all of the virtual hard disks in the specified resource group. Use the nextLink property in the response to get the next page of virtual hard disks. x-ms-original-file: 2025-06-01-preview/VirtualHardDisks_ListByResourceGroup.json | +| [virtualHardDisksUpdateSample.ts][virtualharddisksupdatesample] | the operation to update a virtual hard disk. x-ms-original-file: 2025-06-01-preview/VirtualHardDisks_Update.json | +| [virtualHardDisksUploadSample.ts][virtualharddisksuploadsample] | the operation to upload a virtual hard disk. x-ms-original-file: 2025-06-01-preview/VirtualHardDisks_Upload.json | +| [virtualMachineInstancesCreateOrUpdateSample.ts][virtualmachineinstancescreateorupdatesample] | the operation to create or update a virtual machine instance. Please note some properties can be set only during virtual machine instance creation. x-ms-original-file: 2025-06-01-preview/VirtualMachineInstances_CreateOrUpdate_Put_Virtual_Machine_Instance_With_Gallery_Image.json | +| [virtualMachineInstancesDeleteSample.ts][virtualmachineinstancesdeletesample] | the operation to delete a virtual machine instance. x-ms-original-file: 2025-06-01-preview/VirtualMachineInstances_Delete.json | +| [virtualMachineInstancesGetSample.ts][virtualmachineinstancesgetsample] | gets a virtual machine instance x-ms-original-file: 2025-06-01-preview/VirtualMachineInstances_Get.json | +| [virtualMachineInstancesListSample.ts][virtualmachineinstanceslistsample] | lists all of the virtual machine instances within the specified parent resource. x-ms-original-file: 2025-06-01-preview/VirtualMachineInstances_List.json | +| [virtualMachineInstancesPauseSample.ts][virtualmachineinstancespausesample] | the operation to pause a virtual machine instance. x-ms-original-file: 2025-06-01-preview/VirtualMachineInstances_Pause.json | +| [virtualMachineInstancesRestartSample.ts][virtualmachineinstancesrestartsample] | the operation to restart a virtual machine instance. x-ms-original-file: 2025-06-01-preview/VirtualMachineInstances_Restart.json | +| [virtualMachineInstancesSaveSample.ts][virtualmachineinstancessavesample] | the operation to save a virtual machine instance. x-ms-original-file: 2025-06-01-preview/VirtualMachineInstances_Save.json | +| [virtualMachineInstancesStartSample.ts][virtualmachineinstancesstartsample] | the operation to start a virtual machine instance. x-ms-original-file: 2025-06-01-preview/VirtualMachineInstances_Start.json | +| [virtualMachineInstancesStopSample.ts][virtualmachineinstancesstopsample] | the operation to stop a virtual machine instance. x-ms-original-file: 2025-06-01-preview/VirtualMachineInstances_Stop.json | +| [virtualMachineInstancesUpdateSample.ts][virtualmachineinstancesupdatesample] | the operation to update a virtual machine instance. x-ms-original-file: 2025-06-01-preview/VirtualMachineInstances_Update.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/attestationStatusesGetSample.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/attestationStatusesGetSample.js +``` + +## Next Steps + +Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients. + +[attestationstatusesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/attestationStatusesGetSample.ts +[galleryimagescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/galleryImagesCreateOrUpdateSample.ts +[galleryimagesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/galleryImagesDeleteSample.ts +[galleryimagesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/galleryImagesGetSample.ts +[galleryimageslistallsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/galleryImagesListAllSample.ts +[galleryimageslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/galleryImagesListByResourceGroupSample.ts +[galleryimagesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/galleryImagesUpdateSample.ts +[guestagentscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/guestAgentsCreateSample.ts +[guestagentsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/guestAgentsDeleteSample.ts +[guestagentsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/guestAgentsGetSample.ts +[guestagentslistbyvirtualmachineinstancesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/guestAgentsListByVirtualMachineInstanceSample.ts +[hybrididentitymetadatagetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/hybridIdentityMetadataGetSample.ts +[hybrididentitymetadatalistbyvirtualmachineinstancesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/hybridIdentityMetadataListByVirtualMachineInstanceSample.ts +[logicalnetworkscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/logicalNetworksCreateOrUpdateSample.ts +[logicalnetworksdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/logicalNetworksDeleteSample.ts +[logicalnetworksgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/logicalNetworksGetSample.ts +[logicalnetworkslistallsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/logicalNetworksListAllSample.ts +[logicalnetworkslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/logicalNetworksListByResourceGroupSample.ts +[logicalnetworksupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/logicalNetworksUpdateSample.ts +[marketplacegalleryimagescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/marketplaceGalleryImagesCreateOrUpdateSample.ts +[marketplacegalleryimagesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/marketplaceGalleryImagesDeleteSample.ts +[marketplacegalleryimagesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/marketplaceGalleryImagesGetSample.ts +[marketplacegalleryimageslistallsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/marketplaceGalleryImagesListAllSample.ts +[marketplacegalleryimageslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/marketplaceGalleryImagesListByResourceGroupSample.ts +[marketplacegalleryimagesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/marketplaceGalleryImagesUpdateSample.ts +[networkinterfacescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/networkInterfacesCreateOrUpdateSample.ts +[networkinterfacesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/networkInterfacesDeleteSample.ts +[networkinterfacesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/networkInterfacesGetSample.ts +[networkinterfaceslistallsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/networkInterfacesListAllSample.ts +[networkinterfaceslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/networkInterfacesListByResourceGroupSample.ts +[networkinterfacesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/networkInterfacesUpdateSample.ts +[networksecuritygroupscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/networkSecurityGroupsCreateOrUpdateSample.ts +[networksecuritygroupsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/networkSecurityGroupsDeleteSample.ts +[networksecuritygroupsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/networkSecurityGroupsGetSample.ts +[networksecuritygroupslistallsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/networkSecurityGroupsListAllSample.ts +[networksecuritygroupslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/networkSecurityGroupsListByResourceGroupSample.ts +[networksecuritygroupsupdatetagssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/networkSecurityGroupsUpdateTagsSample.ts +[securityrulescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/securityRulesCreateOrUpdateSample.ts +[securityrulesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/securityRulesDeleteSample.ts +[securityrulesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/securityRulesGetSample.ts +[securityruleslistbynetworksecuritygroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/securityRulesListByNetworkSecurityGroupSample.ts +[storagecontainerscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/storageContainersCreateOrUpdateSample.ts +[storagecontainersdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/storageContainersDeleteSample.ts +[storagecontainersgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/storageContainersGetSample.ts +[storagecontainerslistallsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/storageContainersListAllSample.ts +[storagecontainerslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/storageContainersListByResourceGroupSample.ts +[storagecontainersupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/storageContainersUpdateSample.ts +[virtualharddiskscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/virtualHardDisksCreateOrUpdateSample.ts +[virtualharddisksdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/virtualHardDisksDeleteSample.ts +[virtualharddisksgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/virtualHardDisksGetSample.ts +[virtualharddiskslistallsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/virtualHardDisksListAllSample.ts +[virtualharddiskslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/virtualHardDisksListByResourceGroupSample.ts +[virtualharddisksupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/virtualHardDisksUpdateSample.ts +[virtualharddisksuploadsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/virtualHardDisksUploadSample.ts +[virtualmachineinstancescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/virtualMachineInstancesCreateOrUpdateSample.ts +[virtualmachineinstancesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/virtualMachineInstancesDeleteSample.ts +[virtualmachineinstancesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/virtualMachineInstancesGetSample.ts +[virtualmachineinstanceslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/virtualMachineInstancesListSample.ts +[virtualmachineinstancespausesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/virtualMachineInstancesPauseSample.ts +[virtualmachineinstancesrestartsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/virtualMachineInstancesRestartSample.ts +[virtualmachineinstancessavesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/virtualMachineInstancesSaveSample.ts +[virtualmachineinstancesstartsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/virtualMachineInstancesStartSample.ts +[virtualmachineinstancesstopsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/virtualMachineInstancesStopSample.ts +[virtualmachineinstancesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/virtualMachineInstancesUpdateSample.ts +[apiref]: https://learn.microsoft.com/javascript/api/@azure/arm-azurestackhcivm?view=azure-node-preview +[freesub]: https://azure.microsoft.com/free/ +[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/azurestackhcivm/arm-azurestackhcivm/README.md +[typescript]: https://www.typescriptlang.org/docs/home.html diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/package.json b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/package.json new file mode 100644 index 000000000000..dde401feb1af --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/package.json @@ -0,0 +1,42 @@ +{ + "name": "@azure-samples/arm-azurestackhcivm-ts-beta", + "private": true, + "version": "1.0.0", + "description": "@azure/arm-azurestackhcivm client library samples for TypeScript (Beta)", + "engines": { + "node": ">=20.0.0" + }, + "scripts": { + "build": "tsc", + "prebuild": "rimraf dist/" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/Azure/azure-sdk-for-js.git", + "directory": "sdk/azurestackhcivm/arm-azurestackhcivm" + }, + "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/azurestackhcivm/arm-azurestackhcivm", + "dependencies": { + "@azure/arm-azurestackhcivm": "next", + "dotenv": "latest", + "@azure/identity": "^4.9.0" + }, + "devDependencies": { + "@types/node": "^20.0.0", + "typescript": "~5.8.2", + "rimraf": "latest" + } +} diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/sample.env b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/sample.env new file mode 100644 index 000000000000..508439fc7d62 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/sample.env @@ -0,0 +1 @@ +# Feel free to add your own environment variables. \ No newline at end of file diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/attestationStatusesGetSample.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/attestationStatusesGetSample.ts new file mode 100644 index 000000000000..9e79868a0d86 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/attestationStatusesGetSample.ts @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { AzureStackHCIVMManagementClient } from "@azure/arm-azurestackhcivm"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to implements AttestationStatus GET method. + * + * @summary implements AttestationStatus GET method. + * x-ms-original-file: 2025-06-01-preview/AttestationStatuses_Get.json + */ +async function getAttestationStatus(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-00000000000"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + const result = await client.attestationStatuses.get( + "subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.HybridCompute/machines/DemoVM", + ); + console.log(result); +} + +async function main(): Promise { + await getAttestationStatus(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/galleryImagesCreateOrUpdateSample.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/galleryImagesCreateOrUpdateSample.ts new file mode 100644 index 000000000000..edbb8c498ff1 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/galleryImagesCreateOrUpdateSample.ts @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { AzureStackHCIVMManagementClient } from "@azure/arm-azurestackhcivm"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to the operation to create or update a gallery image. Please note some properties can be set only during gallery image creation. + * + * @summary the operation to create or update a gallery image. Please note some properties can be set only during gallery image creation. + * x-ms-original-file: 2025-06-01-preview/GalleryImages_CreateOrUpdate.json + */ +async function putGalleryImage(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + const result = await client.galleryImages.createOrUpdate("test-rg", "test-gallery-image", { + extendedLocation: { + name: "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location", + type: "CustomLocation", + }, + location: "West US2", + properties: { + containerId: + "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/storageContainers/test-storage-container", + imagePath: "C:\\test.vhdx", + osType: "Linux", + }, + }); + console.log(result); +} + +async function main(): Promise { + await putGalleryImage(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/galleryImagesDeleteSample.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/galleryImagesDeleteSample.ts new file mode 100644 index 000000000000..037b1603a569 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/galleryImagesDeleteSample.ts @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { AzureStackHCIVMManagementClient } from "@azure/arm-azurestackhcivm"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to the operation to delete a gallery image. + * + * @summary the operation to delete a gallery image. + * x-ms-original-file: 2025-06-01-preview/GalleryImages_Delete.json + */ +async function deleteGalleryImage(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + await client.galleryImages.delete("test-rg", "test-gallery-image"); +} + +async function main(): Promise { + await deleteGalleryImage(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/galleryImagesGetSample.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/galleryImagesGetSample.ts new file mode 100644 index 000000000000..a0280555db92 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/galleryImagesGetSample.ts @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { AzureStackHCIVMManagementClient } from "@azure/arm-azurestackhcivm"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to gets a gallery image + * + * @summary gets a gallery image + * x-ms-original-file: 2025-06-01-preview/GalleryImages_Get.json + */ +async function getGalleryImage(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + const result = await client.galleryImages.get("test-rg", "test-gallery-image"); + console.log(result); +} + +async function main(): Promise { + await getGalleryImage(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/galleryImagesListAllSample.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/galleryImagesListAllSample.ts new file mode 100644 index 000000000000..2cc5ffaab1e2 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/galleryImagesListAllSample.ts @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { AzureStackHCIVMManagementClient } from "@azure/arm-azurestackhcivm"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to lists all of the gallery images in the specified subscription. Use the nextLink property in the response to get the next page of gallery images. + * + * @summary lists all of the gallery images in the specified subscription. Use the nextLink property in the response to get the next page of gallery images. + * x-ms-original-file: 2025-06-01-preview/GalleryImages_ListAll.json + */ +async function listGalleryImageBySubscription(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.galleryImages.listAll()) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main(): Promise { + await listGalleryImageBySubscription(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/galleryImagesListByResourceGroupSample.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/galleryImagesListByResourceGroupSample.ts new file mode 100644 index 000000000000..6039828aa2b1 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/galleryImagesListByResourceGroupSample.ts @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { AzureStackHCIVMManagementClient } from "@azure/arm-azurestackhcivm"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to lists all of the gallery images in the specified resource group. Use the nextLink property in the response to get the next page of gallery images. + * + * @summary lists all of the gallery images in the specified resource group. Use the nextLink property in the response to get the next page of gallery images. + * x-ms-original-file: 2025-06-01-preview/GalleryImages_ListByResourceGroup.json + */ +async function listGalleryImageByResourceGroup(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.galleryImages.listByResourceGroup("test-rg")) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main(): Promise { + await listGalleryImageByResourceGroup(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/galleryImagesUpdateSample.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/galleryImagesUpdateSample.ts new file mode 100644 index 000000000000..2a1eef214d51 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/galleryImagesUpdateSample.ts @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { AzureStackHCIVMManagementClient } from "@azure/arm-azurestackhcivm"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to the operation to update a gallery image. + * + * @summary the operation to update a gallery image. + * x-ms-original-file: 2025-06-01-preview/GalleryImages_Update.json + */ +async function updateGalleryImage(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + const result = await client.galleryImages.update("test-rg", "test-gallery-image", { + tags: { additionalProperties: "sample" }, + }); + console.log(result); +} + +async function main(): Promise { + await updateGalleryImage(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/guestAgentsCreateSample.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/guestAgentsCreateSample.ts new file mode 100644 index 000000000000..2e0a46f67c41 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/guestAgentsCreateSample.ts @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { AzureStackHCIVMManagementClient } from "@azure/arm-azurestackhcivm"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to create Or Update GuestAgent. + * + * @summary create Or Update GuestAgent. + * x-ms-original-file: 2025-06-01-preview/GuestAgents_Create.json + */ +async function createGuestAgent(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-00000000000"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + const result = await client.guestAgents.create( + "subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.HybridCompute/machines/DemoVM", + { + properties: { + credentials: { password: "", username: "tempuser" }, + provisioningAction: "install", + }, + }, + ); + console.log(result); +} + +async function main(): Promise { + await createGuestAgent(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/guestAgentsDeleteSample.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/guestAgentsDeleteSample.ts new file mode 100644 index 000000000000..3b96d8ab87ca --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/guestAgentsDeleteSample.ts @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { AzureStackHCIVMManagementClient } from "@azure/arm-azurestackhcivm"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to implements GuestAgent DELETE method. + * + * @summary implements GuestAgent DELETE method. + * x-ms-original-file: 2025-06-01-preview/GuestAgents_Delete.json + */ +async function deleteGuestAgent(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-00000000000"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + await client.guestAgents.delete( + "subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.HybridCompute/machines/DemoVM", + ); +} + +async function main(): Promise { + await deleteGuestAgent(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/guestAgentsGetSample.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/guestAgentsGetSample.ts new file mode 100644 index 000000000000..693cd3739ddb --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/guestAgentsGetSample.ts @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { AzureStackHCIVMManagementClient } from "@azure/arm-azurestackhcivm"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to implements GuestAgent GET method. + * + * @summary implements GuestAgent GET method. + * x-ms-original-file: 2025-06-01-preview/GuestAgents_Get.json + */ +async function getGuestAgent(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-00000000000"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + const result = await client.guestAgents.get( + "subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.HybridCompute/machines/DemoVM", + ); + console.log(result); +} + +async function main(): Promise { + await getGuestAgent(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/guestAgentsListByVirtualMachineInstanceSample.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/guestAgentsListByVirtualMachineInstanceSample.ts new file mode 100644 index 000000000000..5104f15cb01f --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/guestAgentsListByVirtualMachineInstanceSample.ts @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { AzureStackHCIVMManagementClient } from "@azure/arm-azurestackhcivm"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to returns the list of GuestAgent of the given vm. + * + * @summary returns the list of GuestAgent of the given vm. + * x-ms-original-file: 2025-06-01-preview/GuestAgents_ListByVirtualMachineInstance.json + */ +async function guestAgentListByVirtualMachineInstances(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-00000000000"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.guestAgents.listByVirtualMachineInstance( + "subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.HybridCompute/machines/DemoVM", + )) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main(): Promise { + await guestAgentListByVirtualMachineInstances(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/hybridIdentityMetadataGetSample.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/hybridIdentityMetadataGetSample.ts new file mode 100644 index 000000000000..95355925d60f --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/hybridIdentityMetadataGetSample.ts @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { AzureStackHCIVMManagementClient } from "@azure/arm-azurestackhcivm"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to implements HybridIdentityMetadata GET method. + * + * @summary implements HybridIdentityMetadata GET method. + * x-ms-original-file: 2025-06-01-preview/HybridIdentityMetadataGroup_Get.json + */ +async function getHybridIdentityMetadata(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-00000000000"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + const result = await client.hybridIdentityMetadata.get( + "subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.HybridCompute/machines/DemoVM", + ); + console.log(result); +} + +async function main(): Promise { + await getHybridIdentityMetadata(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/hybridIdentityMetadataListByVirtualMachineInstanceSample.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/hybridIdentityMetadataListByVirtualMachineInstanceSample.ts new file mode 100644 index 000000000000..5d586560d292 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/hybridIdentityMetadataListByVirtualMachineInstanceSample.ts @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { AzureStackHCIVMManagementClient } from "@azure/arm-azurestackhcivm"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to returns the list of HybridIdentityMetadata of the given vm. + * + * @summary returns the list of HybridIdentityMetadata of the given vm. + * x-ms-original-file: 2025-06-01-preview/HybridIdentityMetadata_ListByVirtualMachineInstance.json + */ +async function hybridIdentityMetadataListByVirtualMachineInstances(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-00000000000"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.hybridIdentityMetadata.listByVirtualMachineInstance( + "subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.HybridCompute/machines/DemoVM", + )) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main(): Promise { + await hybridIdentityMetadataListByVirtualMachineInstances(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/logicalNetworksCreateOrUpdateSample.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/logicalNetworksCreateOrUpdateSample.ts new file mode 100644 index 000000000000..f987bef7fda3 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/logicalNetworksCreateOrUpdateSample.ts @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { AzureStackHCIVMManagementClient } from "@azure/arm-azurestackhcivm"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to the operation to create or update a logical network. Please note some properties can be set only during logical network creation. + * + * @summary the operation to create or update a logical network. Please note some properties can be set only during logical network creation. + * x-ms-original-file: 2025-06-01-preview/LogicalNetworks_CreateOrUpdate.json + */ +async function putLogicalNetwork(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + const result = await client.logicalNetworks.createOrUpdate("test-rg", "test-lnet", { + extendedLocation: { + name: "/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location", + type: "CustomLocation", + }, + location: "West US2", + }); + console.log(result); +} + +async function main(): Promise { + await putLogicalNetwork(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/logicalNetworksDeleteSample.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/logicalNetworksDeleteSample.ts new file mode 100644 index 000000000000..c4543d3823f4 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/logicalNetworksDeleteSample.ts @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { AzureStackHCIVMManagementClient } from "@azure/arm-azurestackhcivm"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to the operation to delete a logical network. + * + * @summary the operation to delete a logical network. + * x-ms-original-file: 2025-06-01-preview/LogicalNetworks_Delete.json + */ +async function deleteLogicalNetwork(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + await client.logicalNetworks.delete("test-rg", "test-lnet"); +} + +async function main(): Promise { + await deleteLogicalNetwork(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/logicalNetworksGetSample.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/logicalNetworksGetSample.ts new file mode 100644 index 000000000000..ed5ff8bc7133 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/logicalNetworksGetSample.ts @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { AzureStackHCIVMManagementClient } from "@azure/arm-azurestackhcivm"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to the operation to get a logical network. + * + * @summary the operation to get a logical network. + * x-ms-original-file: 2025-06-01-preview/LogicalNetworks_Get.json + */ +async function getLogicalNetwork(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + const result = await client.logicalNetworks.get("test-rg", "test-lnet"); + console.log(result); +} + +async function main(): Promise { + await getLogicalNetwork(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/logicalNetworksListAllSample.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/logicalNetworksListAllSample.ts new file mode 100644 index 000000000000..c11774f38ed1 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/logicalNetworksListAllSample.ts @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { AzureStackHCIVMManagementClient } from "@azure/arm-azurestackhcivm"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to lists all of the logical networks in the specified subscription. Use the nextLink property in the response to get the next page of logical networks. + * + * @summary lists all of the logical networks in the specified subscription. Use the nextLink property in the response to get the next page of logical networks. + * x-ms-original-file: 2025-06-01-preview/LogicalNetworks_ListAll.json + */ +async function listLogicalNetworkBySubscription(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.logicalNetworks.listAll()) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main(): Promise { + await listLogicalNetworkBySubscription(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/logicalNetworksListByResourceGroupSample.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/logicalNetworksListByResourceGroupSample.ts new file mode 100644 index 000000000000..abd2baac2cd8 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/logicalNetworksListByResourceGroupSample.ts @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { AzureStackHCIVMManagementClient } from "@azure/arm-azurestackhcivm"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to lists all of the logical networks in the specified resource group. Use the nextLink property in the response to get the next page of logical networks. + * + * @summary lists all of the logical networks in the specified resource group. Use the nextLink property in the response to get the next page of logical networks. + * x-ms-original-file: 2025-06-01-preview/LogicalNetworks_ListByResourceGroup.json + */ +async function listLogicalNetworkByResourceGroup(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.logicalNetworks.listByResourceGroup("test-rg")) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main(): Promise { + await listLogicalNetworkByResourceGroup(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/logicalNetworksUpdateSample.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/logicalNetworksUpdateSample.ts new file mode 100644 index 000000000000..19787d45c876 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/logicalNetworksUpdateSample.ts @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { AzureStackHCIVMManagementClient } from "@azure/arm-azurestackhcivm"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to the operation to update a logical network. + * + * @summary the operation to update a logical network. + * x-ms-original-file: 2025-06-01-preview/LogicalNetworks_Update.json + */ +async function updateLogicalNetwork(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + const result = await client.logicalNetworks.update("test-rg", "test-lnet", { + tags: { additionalProperties: "sample" }, + }); + console.log(result); +} + +async function main(): Promise { + await updateLogicalNetwork(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/marketplaceGalleryImagesCreateOrUpdateSample.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/marketplaceGalleryImagesCreateOrUpdateSample.ts new file mode 100644 index 000000000000..b81645279528 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/marketplaceGalleryImagesCreateOrUpdateSample.ts @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { AzureStackHCIVMManagementClient } from "@azure/arm-azurestackhcivm"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to the operation to create or update a marketplace gallery image. Please note some properties can be set only during marketplace gallery image creation. + * + * @summary the operation to create or update a marketplace gallery image. Please note some properties can be set only during marketplace gallery image creation. + * x-ms-original-file: 2025-06-01-preview/MarketplaceGalleryImages_CreateOrUpdate.json + */ +async function putMarketplaceGalleryImage(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + const result = await client.marketplaceGalleryImages.createOrUpdate( + "test-rg", + "test-marketplace-gallery-image", + { + extendedLocation: { + name: "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location", + type: "CustomLocation", + }, + location: "West US2", + properties: { + cloudInitDataSource: "Azure", + containerId: + "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/storageContainers/test-storage-container", + hyperVGeneration: "V1", + identifier: { + offer: "myOfferName", + publisher: "myPublisherName", + sku: "mySkuName", + }, + osType: "Windows", + version: { name: "1.0.0" }, + }, + }, + ); + console.log(result); +} + +async function main(): Promise { + await putMarketplaceGalleryImage(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/marketplaceGalleryImagesDeleteSample.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/marketplaceGalleryImagesDeleteSample.ts new file mode 100644 index 000000000000..02c67f21e906 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/marketplaceGalleryImagesDeleteSample.ts @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { AzureStackHCIVMManagementClient } from "@azure/arm-azurestackhcivm"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to the operation to delete a marketplace gallery image. + * + * @summary the operation to delete a marketplace gallery image. + * x-ms-original-file: 2025-06-01-preview/MarketplaceGalleryImages_Delete.json + */ +async function deleteMarketplaceGalleryImage(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + await client.marketplaceGalleryImages.delete("test-rg", "test-marketplace-gallery-image"); +} + +async function main(): Promise { + await deleteMarketplaceGalleryImage(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/marketplaceGalleryImagesGetSample.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/marketplaceGalleryImagesGetSample.ts new file mode 100644 index 000000000000..89d0be01ba8a --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/marketplaceGalleryImagesGetSample.ts @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { AzureStackHCIVMManagementClient } from "@azure/arm-azurestackhcivm"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to gets a marketplace gallery image + * + * @summary gets a marketplace gallery image + * x-ms-original-file: 2025-06-01-preview/MarketplaceGalleryImages_Get.json + */ +async function getMarketplaceGalleryImage(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + const result = await client.marketplaceGalleryImages.get( + "test-rg", + "test-marketplace-gallery-image", + ); + console.log(result); +} + +async function main(): Promise { + await getMarketplaceGalleryImage(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/marketplaceGalleryImagesListAllSample.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/marketplaceGalleryImagesListAllSample.ts new file mode 100644 index 000000000000..b0bad99c288f --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/marketplaceGalleryImagesListAllSample.ts @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { AzureStackHCIVMManagementClient } from "@azure/arm-azurestackhcivm"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to lists all of the marketplace gallery images in the specified subscription. Use the nextLink property in the response to get the next page of marketplace gallery images. + * + * @summary lists all of the marketplace gallery images in the specified subscription. Use the nextLink property in the response to get the next page of marketplace gallery images. + * x-ms-original-file: 2025-06-01-preview/MarketplaceGalleryImages_ListAll.json + */ +async function listMarketplaceGalleryImageBySubscription(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.marketplaceGalleryImages.listAll()) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main(): Promise { + await listMarketplaceGalleryImageBySubscription(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/marketplaceGalleryImagesListByResourceGroupSample.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/marketplaceGalleryImagesListByResourceGroupSample.ts new file mode 100644 index 000000000000..cd3485949cae --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/marketplaceGalleryImagesListByResourceGroupSample.ts @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { AzureStackHCIVMManagementClient } from "@azure/arm-azurestackhcivm"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to lists all of the marketplace gallery images in the specified resource group. Use the nextLink property in the response to get the next page of marketplace gallery images. + * + * @summary lists all of the marketplace gallery images in the specified resource group. Use the nextLink property in the response to get the next page of marketplace gallery images. + * x-ms-original-file: 2025-06-01-preview/MarketplaceGalleryImages_ListByResourceGroup.json + */ +async function listMarketplaceGalleryImageByResourceGroup(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.marketplaceGalleryImages.listByResourceGroup("test-rg")) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main(): Promise { + await listMarketplaceGalleryImageByResourceGroup(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/marketplaceGalleryImagesUpdateSample.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/marketplaceGalleryImagesUpdateSample.ts new file mode 100644 index 000000000000..ebaf2238f316 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/marketplaceGalleryImagesUpdateSample.ts @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { AzureStackHCIVMManagementClient } from "@azure/arm-azurestackhcivm"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to the operation to update a marketplace gallery image. + * + * @summary the operation to update a marketplace gallery image. + * x-ms-original-file: 2025-06-01-preview/MarketplaceGalleryImages_Update.json + */ +async function updateMarketplaceGalleryImage(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + const result = await client.marketplaceGalleryImages.update( + "test-rg", + "test-marketplce-gallery-image", + { tags: { additionalProperties: "sample" } }, + ); + console.log(result); +} + +async function main(): Promise { + await updateMarketplaceGalleryImage(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/networkInterfacesCreateOrUpdateSample.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/networkInterfacesCreateOrUpdateSample.ts new file mode 100644 index 000000000000..554e3f6e498d --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/networkInterfacesCreateOrUpdateSample.ts @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { AzureStackHCIVMManagementClient } from "@azure/arm-azurestackhcivm"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to the operation to create or update a network interface. Please note some properties can be set only during network interface creation. + * + * @summary the operation to create or update a network interface. Please note some properties can be set only during network interface creation. + * x-ms-original-file: 2025-06-01-preview/NetworkInterfaces_CreateOrUpdate.json + */ +async function putNetworkInterface(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + const result = await client.networkInterfaces.createOrUpdate("test-rg", "test-nic", { + extendedLocation: { + name: "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location", + type: "CustomLocation", + }, + location: "eastus", + properties: { + ipConfigurations: [ + { + name: "ipconfig-sample", + properties: { + subnet: { + id: "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/logicalNetworks/test-lnet", + }, + }, + }, + ], + }, + }); + console.log(result); +} + +/** + * This sample demonstrates how to the operation to create or update a network interface. Please note some properties can be set only during network interface creation. + * + * @summary the operation to create or update a network interface. Please note some properties can be set only during network interface creation. + * x-ms-original-file: 2025-06-01-preview/NetworkInterfaces__CreateOrUpdate_CreateFromLocal.json + */ +async function createNetworkInterfaceFromLocal(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + const result = await client.networkInterfaces.createOrUpdate("test-rg", "test-nic", { + extendedLocation: { + name: "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location", + type: "CustomLocation", + }, + location: "eastus", + properties: { + ipConfigurations: [ + { + name: "ipconfig-sample", + properties: { + subnet: { + id: "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/logicalNetworks/test-lnet", + }, + }, + }, + ], + createFromLocal: true, + }, + }); + console.log(result); +} + +async function main(): Promise { + await putNetworkInterface(); + await createNetworkInterfaceFromLocal(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/networkInterfacesDeleteSample.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/networkInterfacesDeleteSample.ts new file mode 100644 index 000000000000..13a757a9ed6d --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/networkInterfacesDeleteSample.ts @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { AzureStackHCIVMManagementClient } from "@azure/arm-azurestackhcivm"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to the operation to delete a network interface. + * + * @summary the operation to delete a network interface. + * x-ms-original-file: 2025-06-01-preview/NetworkInterfaces_Delete.json + */ +async function deleteNetworkInterface(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + await client.networkInterfaces.delete("test-rg", "test-nic"); +} + +async function main(): Promise { + await deleteNetworkInterface(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/networkInterfacesGetSample.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/networkInterfacesGetSample.ts new file mode 100644 index 000000000000..e3769ce505b3 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/networkInterfacesGetSample.ts @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { AzureStackHCIVMManagementClient } from "@azure/arm-azurestackhcivm"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to gets a network interface + * + * @summary gets a network interface + * x-ms-original-file: 2025-06-01-preview/NetworkInterfaces_Get.json + */ +async function getNetworkInterface(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + const result = await client.networkInterfaces.get("test-rg", "test-nic"); + console.log(result); +} + +async function main(): Promise { + await getNetworkInterface(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/networkInterfacesListAllSample.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/networkInterfacesListAllSample.ts new file mode 100644 index 000000000000..513ee7aac960 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/networkInterfacesListAllSample.ts @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { AzureStackHCIVMManagementClient } from "@azure/arm-azurestackhcivm"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to lists all of the network interfaces in the specified subscription. Use the nextLink property in the response to get the next page of network interfaces. + * + * @summary lists all of the network interfaces in the specified subscription. Use the nextLink property in the response to get the next page of network interfaces. + * x-ms-original-file: 2025-06-01-preview/NetworkInterfaces_ListAll.json + */ +async function listNetworkInterfaceBySubscription(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.networkInterfaces.listAll()) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main(): Promise { + await listNetworkInterfaceBySubscription(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/networkInterfacesListByResourceGroupSample.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/networkInterfacesListByResourceGroupSample.ts new file mode 100644 index 000000000000..13cba8ffa827 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/networkInterfacesListByResourceGroupSample.ts @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { AzureStackHCIVMManagementClient } from "@azure/arm-azurestackhcivm"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to lists all of the network interfaces in the specified resource group. Use the nextLink property in the response to get the next page of network interfaces. + * + * @summary lists all of the network interfaces in the specified resource group. Use the nextLink property in the response to get the next page of network interfaces. + * x-ms-original-file: 2025-06-01-preview/NetworkInterfaces_ListByResourceGroup.json + */ +async function listNetworkInterfaceByResourceGroup(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.networkInterfaces.listByResourceGroup("test-rg")) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main(): Promise { + await listNetworkInterfaceByResourceGroup(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/networkInterfacesUpdateSample.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/networkInterfacesUpdateSample.ts new file mode 100644 index 000000000000..98a0b719526c --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/networkInterfacesUpdateSample.ts @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { AzureStackHCIVMManagementClient } from "@azure/arm-azurestackhcivm"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to the operation to update a network interface. + * + * @summary the operation to update a network interface. + * x-ms-original-file: 2025-06-01-preview/NetworkInterfaces_Update.json + */ +async function updateNetworkInterface(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + const result = await client.networkInterfaces.update("test-rg", "test-nic", { + tags: { additionalProperties: "sample" }, + }); + console.log(result); +} + +async function main(): Promise { + await updateNetworkInterface(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/networkSecurityGroupsCreateOrUpdateSample.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/networkSecurityGroupsCreateOrUpdateSample.ts new file mode 100644 index 000000000000..af9c1ac97daa --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/networkSecurityGroupsCreateOrUpdateSample.ts @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { AzureStackHCIVMManagementClient } from "@azure/arm-azurestackhcivm"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to creates or updates a network security group in the specified resource group. + * + * @summary creates or updates a network security group in the specified resource group. + * x-ms-original-file: 2025-06-01-preview/NetworkSecurityGroups_CreateOrUpdate.json + */ +async function createNetworkSecurityGroup(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + const result = await client.networkSecurityGroups.createOrUpdate("testrg", "testnsg", { + location: "eastus", + }); + console.log(result); +} + +async function main(): Promise { + await createNetworkSecurityGroup(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/networkSecurityGroupsDeleteSample.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/networkSecurityGroupsDeleteSample.ts new file mode 100644 index 000000000000..99720f76bb07 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/networkSecurityGroupsDeleteSample.ts @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { AzureStackHCIVMManagementClient } from "@azure/arm-azurestackhcivm"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to deletes the specified network security group. + * + * @summary deletes the specified network security group. + * x-ms-original-file: 2025-06-01-preview/NetworkSecurityGroups_Delete.json + */ +async function deleteNetworkSecurityGroup(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + await client.networkSecurityGroups.delete("test-rg", "testnsg"); +} + +async function main(): Promise { + await deleteNetworkSecurityGroup(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/networkSecurityGroupsGetSample.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/networkSecurityGroupsGetSample.ts new file mode 100644 index 000000000000..37854ae8447b --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/networkSecurityGroupsGetSample.ts @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { AzureStackHCIVMManagementClient } from "@azure/arm-azurestackhcivm"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to gets the specified network security group. + * + * @summary gets the specified network security group. + * x-ms-original-file: 2025-06-01-preview/NetworkSecurityGroups_Get.json + */ +async function getNetworkSecurityGroup(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + const result = await client.networkSecurityGroups.get("test-rg", "testnsg"); + console.log(result); +} + +async function main(): Promise { + await getNetworkSecurityGroup(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/networkSecurityGroupsListAllSample.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/networkSecurityGroupsListAllSample.ts new file mode 100644 index 000000000000..9b33a2c00f8c --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/networkSecurityGroupsListAllSample.ts @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { AzureStackHCIVMManagementClient } from "@azure/arm-azurestackhcivm"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to gets all network security groups in a subscription. + * + * @summary gets all network security groups in a subscription. + * x-ms-original-file: 2025-06-01-preview/NetworkSecurityGroups_ListAll.json + */ +async function listAllNetworkSecurityGroups(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.networkSecurityGroups.listAll()) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main(): Promise { + await listAllNetworkSecurityGroups(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/networkSecurityGroupsListByResourceGroupSample.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/networkSecurityGroupsListByResourceGroupSample.ts new file mode 100644 index 000000000000..bf52dd26218b --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/networkSecurityGroupsListByResourceGroupSample.ts @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { AzureStackHCIVMManagementClient } from "@azure/arm-azurestackhcivm"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to gets all network security groups in a resource group. + * + * @summary gets all network security groups in a resource group. + * x-ms-original-file: 2025-06-01-preview/NetworkSecurityGroups_ListByResourceGroup.json + */ +async function listNetworkSecurityGroupsInResourceGroup(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.networkSecurityGroups.listByResourceGroup("testrg")) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main(): Promise { + await listNetworkSecurityGroupsInResourceGroup(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/networkSecurityGroupsUpdateTagsSample.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/networkSecurityGroupsUpdateTagsSample.ts new file mode 100644 index 000000000000..3512a393380f --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/networkSecurityGroupsUpdateTagsSample.ts @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { AzureStackHCIVMManagementClient } from "@azure/arm-azurestackhcivm"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to updates a network security group tags. + * + * @summary updates a network security group tags. + * x-ms-original-file: 2025-06-01-preview/NetworkSecurityGroups_UpdateTags.json + */ +async function updateNetworkSecurityGroupTags(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + const result = await client.networkSecurityGroups.updateTags("testrg", "testnsg", { + tags: { tag1: "value1", tag2: "value2" }, + }); + console.log(result); +} + +async function main(): Promise { + await updateNetworkSecurityGroupTags(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/securityRulesCreateOrUpdateSample.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/securityRulesCreateOrUpdateSample.ts new file mode 100644 index 000000000000..f2730f3c1eff --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/securityRulesCreateOrUpdateSample.ts @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { AzureStackHCIVMManagementClient } from "@azure/arm-azurestackhcivm"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to creates or updates a security rule in the specified resource group. + * + * @summary creates or updates a security rule in the specified resource group. + * x-ms-original-file: 2025-06-01-preview/SecurityRules_CreateOrUpdate.json + */ +async function securityRulesCreateOrUpdate(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + const result = await client.securityRules.createOrUpdate("testrg", "testnsg", "rule1", { + extendedLocation: { + name: "/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location", + type: "CustomLocation", + }, + properties: { + access: "Allow", + destinationAddressPrefixes: ["*"], + destinationPortRanges: ["80"], + direction: "Inbound", + priority: 130, + sourceAddressPrefixes: ["*"], + sourcePortRanges: ["*"], + protocol: "*", + }, + }); + console.log(result); +} + +async function main(): Promise { + await securityRulesCreateOrUpdate(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/securityRulesDeleteSample.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/securityRulesDeleteSample.ts new file mode 100644 index 000000000000..99af3a094c69 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/securityRulesDeleteSample.ts @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { AzureStackHCIVMManagementClient } from "@azure/arm-azurestackhcivm"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to deletes the specified security rule. + * + * @summary deletes the specified security rule. + * x-ms-original-file: 2025-06-01-preview/SecurityRules_Delete.json + */ +async function securityRulesDelete(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + await client.securityRules.delete("testrg", "testnsg", "rule1"); +} + +async function main(): Promise { + await securityRulesDelete(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/securityRulesGetSample.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/securityRulesGetSample.ts new file mode 100644 index 000000000000..0b742b5be8a4 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/securityRulesGetSample.ts @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { AzureStackHCIVMManagementClient } from "@azure/arm-azurestackhcivm"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to gets the specified security rule. + * + * @summary gets the specified security rule. + * x-ms-original-file: 2025-06-01-preview/SecurityRules_Get.json + */ +async function getNetworkSecurityRuleInNetworkSecurityGroup(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + const result = await client.securityRules.get("testrg", "testnsg", "rule1"); + console.log(result); +} + +async function main(): Promise { + await getNetworkSecurityRuleInNetworkSecurityGroup(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/securityRulesListByNetworkSecurityGroupSample.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/securityRulesListByNetworkSecurityGroupSample.ts new file mode 100644 index 000000000000..d1001c9b7441 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/securityRulesListByNetworkSecurityGroupSample.ts @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { AzureStackHCIVMManagementClient } from "@azure/arm-azurestackhcivm"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to gets all security rules in a Network Security Group. + * + * @summary gets all security rules in a Network Security Group. + * x-ms-original-file: 2025-06-01-preview/SecurityRules_ListByNetworkSecurityGroup.json + */ +async function listNetworkSecurityRulesInNetworkSecurityGroup(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.securityRules.listByNetworkSecurityGroup("testrg", "testnsg")) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main(): Promise { + await listNetworkSecurityRulesInNetworkSecurityGroup(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/storageContainersCreateOrUpdateSample.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/storageContainersCreateOrUpdateSample.ts new file mode 100644 index 000000000000..d8d1214e6a8e --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/storageContainersCreateOrUpdateSample.ts @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { AzureStackHCIVMManagementClient } from "@azure/arm-azurestackhcivm"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to the operation to create or update a storage container. Please note some properties can be set only during storage container creation. + * + * @summary the operation to create or update a storage container. Please note some properties can be set only during storage container creation. + * x-ms-original-file: 2025-06-01-preview/StorageContainers_CreateOrUpdate.json + */ +async function putStorageContainer(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + const result = await client.storageContainers.createOrUpdate("test-rg", "Default_Container", { + extendedLocation: { + name: "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location", + type: "CustomLocation", + }, + location: "West US2", + properties: { path: "C:\\container_storage" }, + }); + console.log(result); +} + +async function main(): Promise { + await putStorageContainer(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/storageContainersDeleteSample.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/storageContainersDeleteSample.ts new file mode 100644 index 000000000000..328c01e09b77 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/storageContainersDeleteSample.ts @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { AzureStackHCIVMManagementClient } from "@azure/arm-azurestackhcivm"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to the operation to delete a storage container. + * + * @summary the operation to delete a storage container. + * x-ms-original-file: 2025-06-01-preview/StorageContainers_Delete.json + */ +async function deleteStorageContainer(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + await client.storageContainers.delete("test-rg", "Default_Container"); +} + +async function main(): Promise { + await deleteStorageContainer(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/storageContainersGetSample.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/storageContainersGetSample.ts new file mode 100644 index 000000000000..d3aec65a8e80 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/storageContainersGetSample.ts @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { AzureStackHCIVMManagementClient } from "@azure/arm-azurestackhcivm"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to gets a storage container + * + * @summary gets a storage container + * x-ms-original-file: 2025-06-01-preview/StorageContainers_Get.json + */ +async function getStorageContainer(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + const result = await client.storageContainers.get("test-rg", "Default_Container"); + console.log(result); +} + +async function main(): Promise { + await getStorageContainer(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/storageContainersListAllSample.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/storageContainersListAllSample.ts new file mode 100644 index 000000000000..2a87b83dc987 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/storageContainersListAllSample.ts @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { AzureStackHCIVMManagementClient } from "@azure/arm-azurestackhcivm"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to lists all of the storage containers in the specified subscription. Use the nextLink property in the response to get the next page of storage containers. + * + * @summary lists all of the storage containers in the specified subscription. Use the nextLink property in the response to get the next page of storage containers. + * x-ms-original-file: 2025-06-01-preview/StorageContainers_ListAll.json + */ +async function listStorageContainerBySubscription(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.storageContainers.listAll()) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main(): Promise { + await listStorageContainerBySubscription(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/storageContainersListByResourceGroupSample.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/storageContainersListByResourceGroupSample.ts new file mode 100644 index 000000000000..27f890cc732b --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/storageContainersListByResourceGroupSample.ts @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { AzureStackHCIVMManagementClient } from "@azure/arm-azurestackhcivm"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to lists all of the storage containers in the specified resource group. Use the nextLink property in the response to get the next page of storage containers. + * + * @summary lists all of the storage containers in the specified resource group. Use the nextLink property in the response to get the next page of storage containers. + * x-ms-original-file: 2025-06-01-preview/StorageContainers_ListByResourceGroup.json + */ +async function listStorageContainerByResourceGroup(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.storageContainers.listByResourceGroup("test-rg")) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main(): Promise { + await listStorageContainerByResourceGroup(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/storageContainersUpdateSample.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/storageContainersUpdateSample.ts new file mode 100644 index 000000000000..f1e6975717bb --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/storageContainersUpdateSample.ts @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { AzureStackHCIVMManagementClient } from "@azure/arm-azurestackhcivm"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to the operation to update a storage container. + * + * @summary the operation to update a storage container. + * x-ms-original-file: 2025-06-01-preview/StorageContainers_Update.json + */ +async function updateStorageContainer(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + const result = await client.storageContainers.update("test-rg", "Default_Container", { + tags: { additionalProperties: "sample" }, + }); + console.log(result); +} + +async function main(): Promise { + await updateStorageContainer(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/virtualHardDisksCreateOrUpdateSample.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/virtualHardDisksCreateOrUpdateSample.ts new file mode 100644 index 000000000000..41d4cf76c0b6 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/virtualHardDisksCreateOrUpdateSample.ts @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { AzureStackHCIVMManagementClient } from "@azure/arm-azurestackhcivm"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to the operation to create or update a virtual hard disk. Please note some properties can be set only during virtual hard disk creation. + * + * @summary the operation to create or update a virtual hard disk. Please note some properties can be set only during virtual hard disk creation. + * x-ms-original-file: 2025-06-01-preview/VirtualHardDisks_CreateOrUpdate.json + */ +async function putVirtualHardDisk(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + const result = await client.virtualHardDisks.createOrUpdate("test-rg", "test-vhd", { + extendedLocation: { + name: "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location", + type: "CustomLocation", + }, + location: "West US2", + properties: { diskSizeGB: 32 }, + }); + console.log(result); +} + +/** + * This sample demonstrates how to the operation to create or update a virtual hard disk. Please note some properties can be set only during virtual hard disk creation. + * + * @summary the operation to create or update a virtual hard disk. Please note some properties can be set only during virtual hard disk creation. + * x-ms-original-file: 2025-06-01-preview/VirtualHardDisks__CreateOrUpdate_CreateFromLocal.json + */ +async function createVirtualHardDiskFromLocal(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + const result = await client.virtualHardDisks.createOrUpdate("test-rg", "test-vhd", { + extendedLocation: { + name: "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location", + type: "CustomLocation", + }, + location: "West US2", + properties: { + createFromLocal: true, + containerId: + "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/storageContainers/test-storage-container", + }, + }); + console.log(result); +} + +async function main(): Promise { + await putVirtualHardDisk(); + await createVirtualHardDiskFromLocal(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/virtualHardDisksDeleteSample.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/virtualHardDisksDeleteSample.ts new file mode 100644 index 000000000000..77265e60fbe7 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/virtualHardDisksDeleteSample.ts @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { AzureStackHCIVMManagementClient } from "@azure/arm-azurestackhcivm"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to the operation to delete a virtual hard disk. + * + * @summary the operation to delete a virtual hard disk. + * x-ms-original-file: 2025-06-01-preview/VirtualHardDisks_Delete.json + */ +async function deleteVirtualHardDisk(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + await client.virtualHardDisks.delete("test-rg", "test-vhd"); +} + +async function main(): Promise { + await deleteVirtualHardDisk(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/virtualHardDisksGetSample.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/virtualHardDisksGetSample.ts new file mode 100644 index 000000000000..5f69ed62f2f2 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/virtualHardDisksGetSample.ts @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { AzureStackHCIVMManagementClient } from "@azure/arm-azurestackhcivm"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to gets a virtual hard disk + * + * @summary gets a virtual hard disk + * x-ms-original-file: 2025-06-01-preview/VirtualHardDisks_Get.json + */ +async function getVirtualHardDisk(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + const result = await client.virtualHardDisks.get("test-rg", "test-vhd"); + console.log(result); +} + +async function main(): Promise { + await getVirtualHardDisk(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/virtualHardDisksListAllSample.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/virtualHardDisksListAllSample.ts new file mode 100644 index 000000000000..30ea45dec436 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/virtualHardDisksListAllSample.ts @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { AzureStackHCIVMManagementClient } from "@azure/arm-azurestackhcivm"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to lists all of the virtual hard disks in the specified subscription. Use the nextLink property in the response to get the next page of virtual hard disks. + * + * @summary lists all of the virtual hard disks in the specified subscription. Use the nextLink property in the response to get the next page of virtual hard disks. + * x-ms-original-file: 2025-06-01-preview/VirtualHardDisks_ListAll.json + */ +async function listVirtualHardDiskBySubscription(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.virtualHardDisks.listAll()) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main(): Promise { + await listVirtualHardDiskBySubscription(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/virtualHardDisksListByResourceGroupSample.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/virtualHardDisksListByResourceGroupSample.ts new file mode 100644 index 000000000000..4441317d4a7c --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/virtualHardDisksListByResourceGroupSample.ts @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { AzureStackHCIVMManagementClient } from "@azure/arm-azurestackhcivm"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to lists all of the virtual hard disks in the specified resource group. Use the nextLink property in the response to get the next page of virtual hard disks. + * + * @summary lists all of the virtual hard disks in the specified resource group. Use the nextLink property in the response to get the next page of virtual hard disks. + * x-ms-original-file: 2025-06-01-preview/VirtualHardDisks_ListByResourceGroup.json + */ +async function listVirtualHardDiskByResourceGroup(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.virtualHardDisks.listByResourceGroup("test-rg")) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main(): Promise { + await listVirtualHardDiskByResourceGroup(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/virtualHardDisksUpdateSample.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/virtualHardDisksUpdateSample.ts new file mode 100644 index 000000000000..62795e06be35 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/virtualHardDisksUpdateSample.ts @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { AzureStackHCIVMManagementClient } from "@azure/arm-azurestackhcivm"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to the operation to update a virtual hard disk. + * + * @summary the operation to update a virtual hard disk. + * x-ms-original-file: 2025-06-01-preview/VirtualHardDisks_Update.json + */ +async function updateVirtualHardDisk(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + const result = await client.virtualHardDisks.update("test-rg", "test-vhd", { + tags: { additionalProperties: "sample" }, + }); + console.log(result); +} + +async function main(): Promise { + await updateVirtualHardDisk(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/virtualHardDisksUploadSample.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/virtualHardDisksUploadSample.ts new file mode 100644 index 000000000000..0b7bb041a37a --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/virtualHardDisksUploadSample.ts @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { AzureStackHCIVMManagementClient } from "@azure/arm-azurestackhcivm"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to the operation to upload a virtual hard disk. + * + * @summary the operation to upload a virtual hard disk. + * x-ms-original-file: 2025-06-01-preview/VirtualHardDisks_Upload.json + */ +async function uploadVirtualHardDisk(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + const result = await client.virtualHardDisks.upload("test-rg", "test-vhd", { + azureManagedDiskUploadUrl: + "https://YourStorageAccountName.blob.core.windows.net/YourContainerName/YourVHDBlobName.vhd?", + }); + console.log(result); +} + +async function main(): Promise { + await uploadVirtualHardDisk(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/virtualMachineInstancesCreateOrUpdateSample.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/virtualMachineInstancesCreateOrUpdateSample.ts new file mode 100644 index 000000000000..460c337bd2b7 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/virtualMachineInstancesCreateOrUpdateSample.ts @@ -0,0 +1,294 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { AzureStackHCIVMManagementClient } from "@azure/arm-azurestackhcivm"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to the operation to create or update a virtual machine instance. Please note some properties can be set only during virtual machine instance creation. + * + * @summary the operation to create or update a virtual machine instance. Please note some properties can be set only during virtual machine instance creation. + * x-ms-original-file: 2025-06-01-preview/VirtualMachineInstances_CreateOrUpdate_Put_Virtual_Machine_Instance_With_Gallery_Image.json + */ +async function putVirtualMachineInstanceWithGalleryImage(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-00000000000"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + const result = await client.virtualMachineInstances.createOrUpdate( + "subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.HybridCompute/machines/DemoVM", + { + extendedLocation: { + name: "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location", + type: "CustomLocation", + }, + properties: { + hardwareProfile: { vmSize: "Default" }, + networkProfile: { + networkInterfaces: [ + { + id: "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/networkInterfaces/test-nic", + }, + ], + }, + osProfile: { + adminPassword: "password", + adminUsername: "localadmin", + computerName: "luamaster", + }, + securityProfile: { + enableTPM: true, + uefiSettings: { secureBootEnabled: true }, + }, + storageProfile: { + imageReference: { + id: "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/galleryImages/test-gallery-image", + }, + vmConfigStoragePathId: + "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/storageContainers/test-container", + }, + }, + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to the operation to create or update a virtual machine instance. Please note some properties can be set only during virtual machine instance creation. + * + * @summary the operation to create or update a virtual machine instance. Please note some properties can be set only during virtual machine instance creation. + * x-ms-original-file: 2025-06-01-preview/VirtualMachineInstances_CreateOrUpdate_Put_Virtual_Machine_Instance_With_Gpu.json + */ +async function putVirtualMachineInstanceWithGpu(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-00000000000"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + const result = await client.virtualMachineInstances.createOrUpdate( + "subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.HybridCompute/machines/DemoVM", + { + extendedLocation: { + name: "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location", + type: "CustomLocation", + }, + properties: { + hardwareProfile: { + vmSize: "Default", + virtualMachineGPUs: [{ assignmentType: "GpuDDA", partitionSizeMB: 0 }], + }, + networkProfile: { + networkInterfaces: [ + { + id: "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/networkInterfaces/test-nic", + }, + ], + }, + osProfile: { + adminPassword: "password", + adminUsername: "localadmin", + computerName: "luamaster", + }, + securityProfile: { + enableTPM: true, + uefiSettings: { secureBootEnabled: true }, + }, + storageProfile: { + imageReference: { + id: "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/galleryImages/test-gallery-image", + }, + vmConfigStoragePathId: + "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/storageContainers/test-container", + }, + }, + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to the operation to create or update a virtual machine instance. Please note some properties can be set only during virtual machine instance creation. + * + * @summary the operation to create or update a virtual machine instance. Please note some properties can be set only during virtual machine instance creation. + * x-ms-original-file: 2025-06-01-preview/VirtualMachineInstances_CreateOrUpdate_Put_Virtual_Machine_Instance_With_Marketplace_Gallery_Image.json + */ +async function putVirtualMachineInstanceWithMarketplaceGalleryImage(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-00000000000"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + const result = await client.virtualMachineInstances.createOrUpdate( + "subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.HybridCompute/machines/DemoVM", + { + extendedLocation: { + name: "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location", + type: "CustomLocation", + }, + properties: { + hardwareProfile: { vmSize: "Default" }, + networkProfile: { + networkInterfaces: [ + { + id: "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/networkInterfaces/test-nic", + }, + ], + }, + osProfile: { + adminPassword: "password", + adminUsername: "localadmin", + computerName: "luamaster", + }, + securityProfile: { + enableTPM: true, + uefiSettings: { secureBootEnabled: true }, + }, + storageProfile: { + imageReference: { + id: "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/marketplaceGalleryImages/test-marketplace-gallery-image", + }, + vmConfigStoragePathId: + "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/storageContainers/test-container", + }, + }, + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to the operation to create or update a virtual machine instance. Please note some properties can be set only during virtual machine instance creation. + * + * @summary the operation to create or update a virtual machine instance. Please note some properties can be set only during virtual machine instance creation. + * x-ms-original-file: 2025-06-01-preview/VirtualMachineInstances_CreateOrUpdate_Put_Virtual_Machine_Instance_With_Os_Disk.json + */ +async function putVirtualMachineInstanceWithOsDisk(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-00000000000"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + const result = await client.virtualMachineInstances.createOrUpdate( + "subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.HybridCompute/machines/DemoVM", + { + extendedLocation: { + name: "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location", + type: "CustomLocation", + }, + properties: { + hardwareProfile: { vmSize: "Default" }, + networkProfile: { + networkInterfaces: [ + { + id: "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/networkInterfaces/test-nic", + }, + ], + }, + securityProfile: { + enableTPM: true, + uefiSettings: { secureBootEnabled: true }, + }, + storageProfile: { + osDisk: { + id: "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/virtualHardDisks/test-vhd", + }, + vmConfigStoragePathId: + "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/storageContainers/test-container", + }, + }, + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to the operation to create or update a virtual machine instance. Please note some properties can be set only during virtual machine instance creation. + * + * @summary the operation to create or update a virtual machine instance. Please note some properties can be set only during virtual machine instance creation. + * x-ms-original-file: 2025-06-01-preview/VirtualMachineInstances_CreateOrUpdate_Put_Virtual_Machine_Instance_With_Vm_Config_Agent.json + */ +async function putVirtualMachineInstanceWithVMConfigAgent(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-00000000000"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + const result = await client.virtualMachineInstances.createOrUpdate( + "subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.HybridCompute/machines/DemoVM", + { + extendedLocation: { + name: "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location", + type: "CustomLocation", + }, + properties: { + hardwareProfile: { vmSize: "Default" }, + networkProfile: { + networkInterfaces: [ + { + id: "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/networkInterfaces/test-nic", + }, + ], + }, + osProfile: { + adminPassword: "password", + adminUsername: "localadmin", + computerName: "luamaster", + windowsConfiguration: { provisionVMConfigAgent: true }, + }, + securityProfile: { + enableTPM: true, + uefiSettings: { secureBootEnabled: true }, + }, + storageProfile: { + imageReference: { + id: "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/galleryImages/test-gallery-image", + }, + vmConfigStoragePathId: + "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/storageContainers/test-container", + }, + }, + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to the operation to create or update a virtual machine instance. Please note some properties can be set only during virtual machine instance creation. + * + * @summary the operation to create or update a virtual machine instance. Please note some properties can be set only during virtual machine instance creation. + * x-ms-original-file: 2025-06-01-preview/VirtualMachineInstances__CreateOrUpdate_CreateFromLocal.json + */ +async function createVirtualMachineInstanceFromLocal(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-00000000000"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + const result = await client.virtualMachineInstances.createOrUpdate( + "subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.HybridCompute/machines/DemoVM", + { + extendedLocation: { + name: "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location", + type: "CustomLocation", + }, + properties: { + networkProfile: { + networkInterfaces: [ + { + id: "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/networkInterfaces/test-nic", + }, + ], + }, + storageProfile: { + dataDisks: [ + { + id: "/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.AzureStackHCI/virtualHardDisks/test-vhd", + }, + ], + }, + createFromLocal: true, + }, + }, + ); + console.log(result); +} + +async function main(): Promise { + await putVirtualMachineInstanceWithGalleryImage(); + await putVirtualMachineInstanceWithGpu(); + await putVirtualMachineInstanceWithMarketplaceGalleryImage(); + await putVirtualMachineInstanceWithOsDisk(); + await putVirtualMachineInstanceWithVMConfigAgent(); + await createVirtualMachineInstanceFromLocal(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/virtualMachineInstancesDeleteSample.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/virtualMachineInstancesDeleteSample.ts new file mode 100644 index 000000000000..b46b35554b1b --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/virtualMachineInstancesDeleteSample.ts @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { AzureStackHCIVMManagementClient } from "@azure/arm-azurestackhcivm"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to the operation to delete a virtual machine instance. + * + * @summary the operation to delete a virtual machine instance. + * x-ms-original-file: 2025-06-01-preview/VirtualMachineInstances_Delete.json + */ +async function deleteVirtualMachine(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-00000000000"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + await client.virtualMachineInstances.delete( + "subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.HybridCompute/machines/DemoVM", + ); +} + +async function main(): Promise { + await deleteVirtualMachine(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/virtualMachineInstancesGetSample.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/virtualMachineInstancesGetSample.ts new file mode 100644 index 000000000000..c754455ce83e --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/virtualMachineInstancesGetSample.ts @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { AzureStackHCIVMManagementClient } from "@azure/arm-azurestackhcivm"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to gets a virtual machine instance + * + * @summary gets a virtual machine instance + * x-ms-original-file: 2025-06-01-preview/VirtualMachineInstances_Get.json + */ +async function getVirtualMachineInstance(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-00000000000"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + const result = await client.virtualMachineInstances.get( + "subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.HybridCompute/machines/DemoVM", + ); + console.log(result); +} + +async function main(): Promise { + await getVirtualMachineInstance(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/virtualMachineInstancesListSample.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/virtualMachineInstancesListSample.ts new file mode 100644 index 000000000000..eb8a45a79081 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/virtualMachineInstancesListSample.ts @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { AzureStackHCIVMManagementClient } from "@azure/arm-azurestackhcivm"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to lists all of the virtual machine instances within the specified parent resource. + * + * @summary lists all of the virtual machine instances within the specified parent resource. + * x-ms-original-file: 2025-06-01-preview/VirtualMachineInstances_List.json + */ +async function listVirtualMachineInstances(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-00000000000"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.virtualMachineInstances.list( + "subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.HybridCompute/machines/DemoVM", + )) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main(): Promise { + await listVirtualMachineInstances(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/virtualMachineInstancesPauseSample.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/virtualMachineInstancesPauseSample.ts new file mode 100644 index 000000000000..102c38cdaccc --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/virtualMachineInstancesPauseSample.ts @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { AzureStackHCIVMManagementClient } from "@azure/arm-azurestackhcivm"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to the operation to pause a virtual machine instance. + * + * @summary the operation to pause a virtual machine instance. + * x-ms-original-file: 2025-06-01-preview/VirtualMachineInstances_Pause.json + */ +async function pauseVirtualMachine(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-00000000000"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + await client.virtualMachineInstances.pause( + "subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/Microsoft.HybridCompute/machines/DemoVM/providers/Microsoft.AzureStackHCI/virtualMachineInstances/default", + ); +} + +async function main(): Promise { + await pauseVirtualMachine(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/virtualMachineInstancesRestartSample.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/virtualMachineInstancesRestartSample.ts new file mode 100644 index 000000000000..4147e794507b --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/virtualMachineInstancesRestartSample.ts @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { AzureStackHCIVMManagementClient } from "@azure/arm-azurestackhcivm"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to the operation to restart a virtual machine instance. + * + * @summary the operation to restart a virtual machine instance. + * x-ms-original-file: 2025-06-01-preview/VirtualMachineInstances_Restart.json + */ +async function restartVirtualMachine(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-00000000000"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + await client.virtualMachineInstances.restart( + "subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.HybridCompute/machines/DemoVM/providers/Microsoft.AzureStackHCI/virtualMachineInstances/default", + ); +} + +async function main(): Promise { + await restartVirtualMachine(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/virtualMachineInstancesSaveSample.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/virtualMachineInstancesSaveSample.ts new file mode 100644 index 000000000000..a35ffba316dd --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/virtualMachineInstancesSaveSample.ts @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { AzureStackHCIVMManagementClient } from "@azure/arm-azurestackhcivm"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to the operation to save a virtual machine instance. + * + * @summary the operation to save a virtual machine instance. + * x-ms-original-file: 2025-06-01-preview/VirtualMachineInstances_Save.json + */ +async function saveVirtualMachine(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-00000000000"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + await client.virtualMachineInstances.save( + "subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/Microsoft.HybridCompute/machines/DemoVM/providers/Microsoft.AzureStackHCI/virtualMachineInstances/default", + ); +} + +async function main(): Promise { + await saveVirtualMachine(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/virtualMachineInstancesStartSample.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/virtualMachineInstancesStartSample.ts new file mode 100644 index 000000000000..272cb70e08a2 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/virtualMachineInstancesStartSample.ts @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { AzureStackHCIVMManagementClient } from "@azure/arm-azurestackhcivm"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to the operation to start a virtual machine instance. + * + * @summary the operation to start a virtual machine instance. + * x-ms-original-file: 2025-06-01-preview/VirtualMachineInstances_Start.json + */ +async function startVirtualMachine(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-00000000000"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + await client.virtualMachineInstances.start( + "subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.HybridCompute/machines/DemoVM/providers/Microsoft.AzureStackHCI/virtualMachineInstances/default", + ); +} + +async function main(): Promise { + await startVirtualMachine(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/virtualMachineInstancesStopSample.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/virtualMachineInstancesStopSample.ts new file mode 100644 index 000000000000..992434660b91 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/virtualMachineInstancesStopSample.ts @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { AzureStackHCIVMManagementClient } from "@azure/arm-azurestackhcivm"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to the operation to stop a virtual machine instance. + * + * @summary the operation to stop a virtual machine instance. + * x-ms-original-file: 2025-06-01-preview/VirtualMachineInstances_Stop.json + */ +async function stopVirtualMachine(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-00000000000"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + await client.virtualMachineInstances.stop( + "subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.HybridCompute/machines/DemoVM/providers/Microsoft.AzureStackHCI/virtualMachineInstances/default", + ); +} + +async function main(): Promise { + await stopVirtualMachine(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/virtualMachineInstancesUpdateSample.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/virtualMachineInstancesUpdateSample.ts new file mode 100644 index 000000000000..8bc4c51846b0 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/src/virtualMachineInstancesUpdateSample.ts @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { AzureStackHCIVMManagementClient } from "@azure/arm-azurestackhcivm"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to the operation to update a virtual machine instance. + * + * @summary the operation to update a virtual machine instance. + * x-ms-original-file: 2025-06-01-preview/VirtualMachineInstances_Update.json + */ +async function updateVirtualMachine(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-00000000000"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + const result = await client.virtualMachineInstances.update( + "subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.HybridCompute/machines/DemoVM", + { + properties: { + storageProfile: { + dataDisks: [ + { + id: "/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.AzureStackHCI/virtualHardDisks/test-vhd", + }, + ], + }, + }, + }, + ); + console.log(result); +} + +async function main(): Promise { + await updateVirtualMachine(); +} + +main().catch(console.error); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/tsconfig.json b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/tsconfig.json new file mode 100644 index 000000000000..400db87cf648 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/samples/v1-beta/typescript/tsconfig.json @@ -0,0 +1,20 @@ +{ + "compilerOptions": { + "target": "ES2023", + "module": "commonjs", + "lib": [], + "importHelpers": true, + "strict": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "noImplicitReturns": true, + "noFallthroughCasesInSwitch": true, + "moduleResolution": "node10", + "esModuleInterop": true, + "outDir": "./dist", + "resolveJsonModule": true + }, + "include": [ + "./src" + ] +} diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/src/api/attestationStatuses/index.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/src/api/attestationStatuses/index.ts new file mode 100644 index 000000000000..428d438ebd1c --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/src/api/attestationStatuses/index.ts @@ -0,0 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { get } from "./operations.js"; +export { AttestationStatusesGetOptionalParams } from "./options.js"; diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/src/api/attestationStatuses/operations.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/src/api/attestationStatuses/operations.ts new file mode 100644 index 000000000000..ffea44f40bcb --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/src/api/attestationStatuses/operations.ts @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { AzureStackHCIVMManagementContext as Client } from "../index.js"; +import { + errorResponseDeserializer, + AttestationStatus, + attestationStatusDeserializer, +} from "../../models/models.js"; +import { expandUrlTemplate } from "../../static-helpers/urlTemplate.js"; +import { AttestationStatusesGetOptionalParams } from "./options.js"; +import { + StreamableMethod, + PathUncheckedResponse, + createRestError, + operationOptionsToRequestParameters, +} from "@azure-rest/core-client"; + +export function _getSend( + context: Client, + resourceUri: string, + options: AttestationStatusesGetOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/{+resourceUri}/providers/Microsoft.AzureStackHCI/virtualMachineInstances/default/attestationStatus/default{?api%2Dversion}", + { + resourceUri: resourceUri, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).get({ + ...operationOptionsToRequestParameters(options), + headers: { + accept: "application/json", + ...options.requestOptions?.headers, + }, + }); +} + +export async function _getDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return attestationStatusDeserializer(result.body); +} + +/** Implements AttestationStatus GET method. */ +export async function get( + context: Client, + resourceUri: string, + options: AttestationStatusesGetOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _getSend(context, resourceUri, options); + return _getDeserialize(result); +} diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/src/api/attestationStatuses/options.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/src/api/attestationStatuses/options.ts new file mode 100644 index 000000000000..07a0a54e54ad --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/src/api/attestationStatuses/options.ts @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { OperationOptions } from "@azure-rest/core-client"; + +/** Optional parameters. */ +export interface AttestationStatusesGetOptionalParams extends OperationOptions {} diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/src/api/azureStackHcivmManagementContext.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/src/api/azureStackHcivmManagementContext.ts new file mode 100644 index 000000000000..cbe2775c23b0 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/src/api/azureStackHcivmManagementContext.ts @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { logger } from "../logger.js"; +import { KnownVersions } from "../models/models.js"; +import { AzureSupportedClouds, getArmEndpoint } from "../static-helpers/cloudSettingHelpers.js"; +import { Client, ClientOptions, getClient } from "@azure-rest/core-client"; +import { TokenCredential } from "@azure/core-auth"; + +/** Azure Stack HCI management service */ +export interface AzureStackHCIVMManagementContext extends Client { + /** The API version to use for this operation. */ + /** Known values of {@link KnownVersions} that the service accepts. */ + apiVersion: string; + /** The ID of the target subscription. The value must be an UUID. */ + subscriptionId: string; +} + +/** Optional parameters for the client. */ +export interface AzureStackHCIVMManagementClientOptionalParams extends ClientOptions { + /** The API version to use for this operation. */ + /** Known values of {@link KnownVersions} that the service accepts. */ + apiVersion?: string; + /** Specifies the Azure cloud environment for the client. */ + cloudSetting?: AzureSupportedClouds; +} + +/** Azure Stack HCI management service */ +export function createAzureStackHCIVMManagement( + credential: TokenCredential, + subscriptionId: string, + options: AzureStackHCIVMManagementClientOptionalParams = {}, +): AzureStackHCIVMManagementContext { + const endpointUrl = + options.endpoint ?? getArmEndpoint(options.cloudSetting) ?? "https://management.azure.com"; + const prefixFromOptions = options?.userAgentOptions?.userAgentPrefix; + const userAgentInfo = `azsdk-js-arm-azurestackhcivm/1.0.0-beta.1`; + const userAgentPrefix = prefixFromOptions + ? `${prefixFromOptions} azsdk-js-api ${userAgentInfo}` + : `azsdk-js-api ${userAgentInfo}`; + const { apiVersion: _, ...updatedOptions } = { + ...options, + userAgentOptions: { userAgentPrefix }, + loggingOptions: { logger: options.loggingOptions?.logger ?? logger.info }, + credentials: { + scopes: options.credentials?.scopes ?? [`${endpointUrl}/.default`], + }, + }; + const clientContext = getClient(endpointUrl, credential, updatedOptions); + clientContext.pipeline.removePolicy({ name: "ApiVersionPolicy" }); + const apiVersion = options.apiVersion ?? "2025-06-01-preview"; + clientContext.pipeline.addPolicy({ + name: "ClientApiVersionPolicy", + sendRequest: (req, next) => { + // Use the apiVersion defined in request url directly + // Append one if there is no apiVersion and we have one at client options + const url = new URL(req.url); + if (!url.searchParams.get("api-version")) { + req.url = `${req.url}${ + Array.from(url.searchParams.keys()).length > 0 ? "&" : "?" + }api-version=${apiVersion}`; + } + + return next(req); + }, + }); + return { + ...clientContext, + apiVersion, + subscriptionId, + } as AzureStackHCIVMManagementContext; +} diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/src/api/galleryImages/index.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/src/api/galleryImages/index.ts new file mode 100644 index 000000000000..83bd6daf3020 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/src/api/galleryImages/index.ts @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { + listAll, + listByResourceGroup, + $delete, + update, + createOrUpdate, + get, +} from "./operations.js"; +export { + GalleryImagesListAllOptionalParams, + GalleryImagesListByResourceGroupOptionalParams, + GalleryImagesDeleteOptionalParams, + GalleryImagesUpdateOptionalParams, + GalleryImagesCreateOrUpdateOptionalParams, + GalleryImagesGetOptionalParams, +} from "./options.js"; diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/src/api/galleryImages/operations.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/src/api/galleryImages/operations.ts new file mode 100644 index 000000000000..f3fea71ea85f --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/src/api/galleryImages/operations.ts @@ -0,0 +1,361 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { AzureStackHCIVMManagementContext as Client } from "../index.js"; +import { + GalleryImage, + galleryImageSerializer, + galleryImageDeserializer, + errorResponseDeserializer, + GalleryImageTagsUpdate, + galleryImageTagsUpdateSerializer, + _GalleryImageListResult, + _galleryImageListResultDeserializer, +} from "../../models/models.js"; +import { + PagedAsyncIterableIterator, + buildPagedAsyncIterator, +} from "../../static-helpers/pagingHelpers.js"; +import { getLongRunningPoller } from "../../static-helpers/pollingHelpers.js"; +import { expandUrlTemplate } from "../../static-helpers/urlTemplate.js"; +import { + GalleryImagesListAllOptionalParams, + GalleryImagesListByResourceGroupOptionalParams, + GalleryImagesDeleteOptionalParams, + GalleryImagesUpdateOptionalParams, + GalleryImagesCreateOrUpdateOptionalParams, + GalleryImagesGetOptionalParams, +} from "./options.js"; +import { + StreamableMethod, + PathUncheckedResponse, + createRestError, + operationOptionsToRequestParameters, +} from "@azure-rest/core-client"; +import { PollerLike, OperationState } from "@azure/core-lro"; + +export function _listAllSend( + context: Client, + options: GalleryImagesListAllOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/providers/Microsoft.AzureStackHCI/galleryImages{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).get({ + ...operationOptionsToRequestParameters(options), + headers: { + accept: "application/json", + ...options.requestOptions?.headers, + }, + }); +} + +export async function _listAllDeserialize( + result: PathUncheckedResponse, +): Promise<_GalleryImageListResult> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return _galleryImageListResultDeserializer(result.body); +} + +/** Lists all of the gallery images in the specified subscription. Use the nextLink property in the response to get the next page of gallery images. */ +export function listAll( + context: Client, + options: GalleryImagesListAllOptionalParams = { requestOptions: {} }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _listAllSend(context, options), + _listAllDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink" }, + ); +} + +export function _listByResourceGroupSend( + context: Client, + resourceGroupName: string, + options: GalleryImagesListByResourceGroupOptionalParams = { + requestOptions: {}, + }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/galleryImages{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).get({ + ...operationOptionsToRequestParameters(options), + headers: { + accept: "application/json", + ...options.requestOptions?.headers, + }, + }); +} + +export async function _listByResourceGroupDeserialize( + result: PathUncheckedResponse, +): Promise<_GalleryImageListResult> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return _galleryImageListResultDeserializer(result.body); +} + +/** Lists all of the gallery images in the specified resource group. Use the nextLink property in the response to get the next page of gallery images. */ +export function listByResourceGroup( + context: Client, + resourceGroupName: string, + options: GalleryImagesListByResourceGroupOptionalParams = { + requestOptions: {}, + }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _listByResourceGroupSend(context, resourceGroupName, options), + _listByResourceGroupDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink" }, + ); +} + +export function _$deleteSend( + context: Client, + resourceGroupName: string, + galleryImageName: string, + options: GalleryImagesDeleteOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/galleryImages/{galleryImageName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + galleryImageName: galleryImageName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).delete({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _$deleteDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["202", "204", "200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return; +} + +/** The operation to delete a gallery image. */ +/** + * @fixme delete is a reserved word that cannot be used as an operation name. + * Please add @clientName("clientName") or @clientName("", "javascript") + * to the operation to override the generated name. + */ +export function $delete( + context: Client, + resourceGroupName: string, + galleryImageName: string, + options: GalleryImagesDeleteOptionalParams = { requestOptions: {} }, +): PollerLike, void> { + return getLongRunningPoller(context, _$deleteDeserialize, ["202", "204", "200"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => _$deleteSend(context, resourceGroupName, galleryImageName, options), + resourceLocationConfig: "location", + }) as PollerLike, void>; +} + +export function _updateSend( + context: Client, + resourceGroupName: string, + galleryImageName: string, + properties: GalleryImageTagsUpdate, + options: GalleryImagesUpdateOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/galleryImages/{galleryImageName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + galleryImageName: galleryImageName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).patch({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { + accept: "application/json", + ...options.requestOptions?.headers, + }, + body: galleryImageTagsUpdateSerializer(properties), + }); +} + +export async function _updateDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["200", "202"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return galleryImageDeserializer(result.body); +} + +/** The operation to update a gallery image. */ +export function update( + context: Client, + resourceGroupName: string, + galleryImageName: string, + properties: GalleryImageTagsUpdate, + options: GalleryImagesUpdateOptionalParams = { requestOptions: {} }, +): PollerLike, GalleryImage> { + return getLongRunningPoller(context, _updateDeserialize, ["200", "202"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _updateSend(context, resourceGroupName, galleryImageName, properties, options), + resourceLocationConfig: "location", + }) as PollerLike, GalleryImage>; +} + +export function _createOrUpdateSend( + context: Client, + resourceGroupName: string, + galleryImageName: string, + resource: GalleryImage, + options: GalleryImagesCreateOrUpdateOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/galleryImages/{galleryImageName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + galleryImageName: galleryImageName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).put({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { + accept: "application/json", + ...options.requestOptions?.headers, + }, + body: galleryImageSerializer(resource), + }); +} + +export async function _createOrUpdateDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200", "201", "202"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return galleryImageDeserializer(result.body); +} + +/** The operation to create or update a gallery image. Please note some properties can be set only during gallery image creation. */ +export function createOrUpdate( + context: Client, + resourceGroupName: string, + galleryImageName: string, + resource: GalleryImage, + options: GalleryImagesCreateOrUpdateOptionalParams = { requestOptions: {} }, +): PollerLike, GalleryImage> { + return getLongRunningPoller(context, _createOrUpdateDeserialize, ["200", "201", "202"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _createOrUpdateSend(context, resourceGroupName, galleryImageName, resource, options), + resourceLocationConfig: "azure-async-operation", + }) as PollerLike, GalleryImage>; +} + +export function _getSend( + context: Client, + resourceGroupName: string, + galleryImageName: string, + options: GalleryImagesGetOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/galleryImages/{galleryImageName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + galleryImageName: galleryImageName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).get({ + ...operationOptionsToRequestParameters(options), + headers: { + accept: "application/json", + ...options.requestOptions?.headers, + }, + }); +} + +export async function _getDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return galleryImageDeserializer(result.body); +} + +/** Gets a gallery image */ +export async function get( + context: Client, + resourceGroupName: string, + galleryImageName: string, + options: GalleryImagesGetOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _getSend(context, resourceGroupName, galleryImageName, options); + return _getDeserialize(result); +} diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/src/api/galleryImages/options.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/src/api/galleryImages/options.ts new file mode 100644 index 000000000000..a0659cc32a00 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/src/api/galleryImages/options.ts @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { OperationOptions } from "@azure-rest/core-client"; + +/** Optional parameters. */ +export interface GalleryImagesListAllOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface GalleryImagesListByResourceGroupOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface GalleryImagesDeleteOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface GalleryImagesUpdateOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface GalleryImagesCreateOrUpdateOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface GalleryImagesGetOptionalParams extends OperationOptions {} diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/src/api/guestAgents/index.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/src/api/guestAgents/index.ts new file mode 100644 index 000000000000..8b2b293eb513 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/src/api/guestAgents/index.ts @@ -0,0 +1,10 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { listByVirtualMachineInstance, $delete, create, get } from "./operations.js"; +export { + GuestAgentsListByVirtualMachineInstanceOptionalParams, + GuestAgentsDeleteOptionalParams, + GuestAgentsCreateOptionalParams, + GuestAgentsGetOptionalParams, +} from "./options.js"; diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/src/api/guestAgents/operations.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/src/api/guestAgents/operations.ts new file mode 100644 index 000000000000..6c436d381f32 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/src/api/guestAgents/operations.ts @@ -0,0 +1,233 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { AzureStackHCIVMManagementContext as Client } from "../index.js"; +import { + errorResponseDeserializer, + GuestAgent, + guestAgentSerializer, + guestAgentDeserializer, + _GuestAgentListResult, + _guestAgentListResultDeserializer, +} from "../../models/models.js"; +import { + PagedAsyncIterableIterator, + buildPagedAsyncIterator, +} from "../../static-helpers/pagingHelpers.js"; +import { getLongRunningPoller } from "../../static-helpers/pollingHelpers.js"; +import { expandUrlTemplate } from "../../static-helpers/urlTemplate.js"; +import { + GuestAgentsListByVirtualMachineInstanceOptionalParams, + GuestAgentsDeleteOptionalParams, + GuestAgentsCreateOptionalParams, + GuestAgentsGetOptionalParams, +} from "./options.js"; +import { + StreamableMethod, + PathUncheckedResponse, + createRestError, + operationOptionsToRequestParameters, +} from "@azure-rest/core-client"; +import { PollerLike, OperationState } from "@azure/core-lro"; + +export function _listByVirtualMachineInstanceSend( + context: Client, + resourceUri: string, + options: GuestAgentsListByVirtualMachineInstanceOptionalParams = { + requestOptions: {}, + }, +): StreamableMethod { + const path = expandUrlTemplate( + "/{+resourceUri}/providers/Microsoft.AzureStackHCI/virtualMachineInstances/default/guestAgents{?api%2Dversion}", + { + resourceUri: resourceUri, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).get({ + ...operationOptionsToRequestParameters(options), + headers: { + accept: "application/json", + ...options.requestOptions?.headers, + }, + }); +} + +export async function _listByVirtualMachineInstanceDeserialize( + result: PathUncheckedResponse, +): Promise<_GuestAgentListResult> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return _guestAgentListResultDeserializer(result.body); +} + +/** Returns the list of GuestAgent of the given vm. */ +export function listByVirtualMachineInstance( + context: Client, + resourceUri: string, + options: GuestAgentsListByVirtualMachineInstanceOptionalParams = { + requestOptions: {}, + }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _listByVirtualMachineInstanceSend(context, resourceUri, options), + _listByVirtualMachineInstanceDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink" }, + ); +} + +export function _$deleteSend( + context: Client, + resourceUri: string, + options: GuestAgentsDeleteOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/{+resourceUri}/providers/Microsoft.AzureStackHCI/virtualMachineInstances/default/guestAgents/default{?api%2Dversion}", + { + resourceUri: resourceUri, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).delete({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _$deleteDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["202", "204", "200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return; +} + +/** Implements GuestAgent DELETE method. */ +/** + * @fixme delete is a reserved word that cannot be used as an operation name. + * Please add @clientName("clientName") or @clientName("", "javascript") + * to the operation to override the generated name. + */ +export function $delete( + context: Client, + resourceUri: string, + options: GuestAgentsDeleteOptionalParams = { requestOptions: {} }, +): PollerLike, void> { + return getLongRunningPoller(context, _$deleteDeserialize, ["202", "204", "200"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => _$deleteSend(context, resourceUri, options), + resourceLocationConfig: "location", + }) as PollerLike, void>; +} + +export function _createSend( + context: Client, + resourceUri: string, + resource: GuestAgent, + options: GuestAgentsCreateOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/{+resourceUri}/providers/Microsoft.AzureStackHCI/virtualMachineInstances/default/guestAgents/default{?api%2Dversion}", + { + resourceUri: resourceUri, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).put({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { + accept: "application/json", + ...options.requestOptions?.headers, + }, + body: guestAgentSerializer(resource), + }); +} + +export async function _createDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["200", "201", "202"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return guestAgentDeserializer(result.body); +} + +/** Create Or Update GuestAgent. */ +export function create( + context: Client, + resourceUri: string, + resource: GuestAgent, + options: GuestAgentsCreateOptionalParams = { requestOptions: {} }, +): PollerLike, GuestAgent> { + return getLongRunningPoller(context, _createDeserialize, ["200", "201", "202"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => _createSend(context, resourceUri, resource, options), + resourceLocationConfig: "azure-async-operation", + }) as PollerLike, GuestAgent>; +} + +export function _getSend( + context: Client, + resourceUri: string, + options: GuestAgentsGetOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/{+resourceUri}/providers/Microsoft.AzureStackHCI/virtualMachineInstances/default/guestAgents/default{?api%2Dversion}", + { + resourceUri: resourceUri, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).get({ + ...operationOptionsToRequestParameters(options), + headers: { + accept: "application/json", + ...options.requestOptions?.headers, + }, + }); +} + +export async function _getDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return guestAgentDeserializer(result.body); +} + +/** Implements GuestAgent GET method. */ +export async function get( + context: Client, + resourceUri: string, + options: GuestAgentsGetOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _getSend(context, resourceUri, options); + return _getDeserialize(result); +} diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/src/api/guestAgents/options.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/src/api/guestAgents/options.ts new file mode 100644 index 000000000000..0f598b5fdcb7 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/src/api/guestAgents/options.ts @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { OperationOptions } from "@azure-rest/core-client"; + +/** Optional parameters. */ +export interface GuestAgentsListByVirtualMachineInstanceOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface GuestAgentsDeleteOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface GuestAgentsCreateOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface GuestAgentsGetOptionalParams extends OperationOptions {} diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/src/api/hybridIdentityMetadata/index.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/src/api/hybridIdentityMetadata/index.ts new file mode 100644 index 000000000000..38b9c32ea4be --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/src/api/hybridIdentityMetadata/index.ts @@ -0,0 +1,8 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { listByVirtualMachineInstance, get } from "./operations.js"; +export { + HybridIdentityMetadataListByVirtualMachineInstanceOptionalParams, + HybridIdentityMetadataGetOptionalParams, +} from "./options.js"; diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/src/api/hybridIdentityMetadata/operations.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/src/api/hybridIdentityMetadata/operations.ts new file mode 100644 index 000000000000..efe6949614c9 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/src/api/hybridIdentityMetadata/operations.ts @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { AzureStackHCIVMManagementContext as Client } from "../index.js"; +import { + errorResponseDeserializer, + HybridIdentityMetadata, + hybridIdentityMetadataDeserializer, + _HybridIdentityMetadataListResult, + _hybridIdentityMetadataListResultDeserializer, +} from "../../models/models.js"; +import { + PagedAsyncIterableIterator, + buildPagedAsyncIterator, +} from "../../static-helpers/pagingHelpers.js"; +import { expandUrlTemplate } from "../../static-helpers/urlTemplate.js"; +import { + HybridIdentityMetadataListByVirtualMachineInstanceOptionalParams, + HybridIdentityMetadataGetOptionalParams, +} from "./options.js"; +import { + StreamableMethod, + PathUncheckedResponse, + createRestError, + operationOptionsToRequestParameters, +} from "@azure-rest/core-client"; + +export function _listByVirtualMachineInstanceSend( + context: Client, + resourceUri: string, + options: HybridIdentityMetadataListByVirtualMachineInstanceOptionalParams = { + requestOptions: {}, + }, +): StreamableMethod { + const path = expandUrlTemplate( + "/{+resourceUri}/providers/Microsoft.AzureStackHCI/virtualMachineInstances/default/hybridIdentityMetadata{?api%2Dversion}", + { + resourceUri: resourceUri, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).get({ + ...operationOptionsToRequestParameters(options), + headers: { + accept: "application/json", + ...options.requestOptions?.headers, + }, + }); +} + +export async function _listByVirtualMachineInstanceDeserialize( + result: PathUncheckedResponse, +): Promise<_HybridIdentityMetadataListResult> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return _hybridIdentityMetadataListResultDeserializer(result.body); +} + +/** Returns the list of HybridIdentityMetadata of the given vm. */ +export function listByVirtualMachineInstance( + context: Client, + resourceUri: string, + options: HybridIdentityMetadataListByVirtualMachineInstanceOptionalParams = { + requestOptions: {}, + }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _listByVirtualMachineInstanceSend(context, resourceUri, options), + _listByVirtualMachineInstanceDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink" }, + ); +} + +export function _getSend( + context: Client, + resourceUri: string, + options: HybridIdentityMetadataGetOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/{+resourceUri}/providers/Microsoft.AzureStackHCI/virtualMachineInstances/default/hybridIdentityMetadata/default{?api%2Dversion}", + { + resourceUri: resourceUri, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).get({ + ...operationOptionsToRequestParameters(options), + headers: { + accept: "application/json", + ...options.requestOptions?.headers, + }, + }); +} + +export async function _getDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return hybridIdentityMetadataDeserializer(result.body); +} + +/** Implements HybridIdentityMetadata GET method. */ +export async function get( + context: Client, + resourceUri: string, + options: HybridIdentityMetadataGetOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _getSend(context, resourceUri, options); + return _getDeserialize(result); +} diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/src/api/hybridIdentityMetadata/options.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/src/api/hybridIdentityMetadata/options.ts new file mode 100644 index 000000000000..774071e3a2fb --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/src/api/hybridIdentityMetadata/options.ts @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { OperationOptions } from "@azure-rest/core-client"; + +/** Optional parameters. */ +export interface HybridIdentityMetadataListByVirtualMachineInstanceOptionalParams + extends OperationOptions {} + +/** Optional parameters. */ +export interface HybridIdentityMetadataGetOptionalParams extends OperationOptions {} diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/src/api/index.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/src/api/index.ts new file mode 100644 index 000000000000..535a267d8349 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/src/api/index.ts @@ -0,0 +1,8 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { + createAzureStackHCIVMManagement, + AzureStackHCIVMManagementContext, + AzureStackHCIVMManagementClientOptionalParams, +} from "./azureStackHcivmManagementContext.js"; diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/src/api/logicalNetworks/index.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/src/api/logicalNetworks/index.ts new file mode 100644 index 000000000000..5cdcee4599d5 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/src/api/logicalNetworks/index.ts @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { + listAll, + listByResourceGroup, + $delete, + update, + createOrUpdate, + get, +} from "./operations.js"; +export { + LogicalNetworksListAllOptionalParams, + LogicalNetworksListByResourceGroupOptionalParams, + LogicalNetworksDeleteOptionalParams, + LogicalNetworksUpdateOptionalParams, + LogicalNetworksCreateOrUpdateOptionalParams, + LogicalNetworksGetOptionalParams, +} from "./options.js"; diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/src/api/logicalNetworks/operations.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/src/api/logicalNetworks/operations.ts new file mode 100644 index 000000000000..ba8ae06f4b69 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/src/api/logicalNetworks/operations.ts @@ -0,0 +1,361 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { AzureStackHCIVMManagementContext as Client } from "../index.js"; +import { + errorResponseDeserializer, + LogicalNetwork, + logicalNetworkSerializer, + logicalNetworkDeserializer, + LogicalNetworksUpdateRequest, + logicalNetworksUpdateRequestSerializer, + _LogicalNetworkListResult, + _logicalNetworkListResultDeserializer, +} from "../../models/models.js"; +import { + PagedAsyncIterableIterator, + buildPagedAsyncIterator, +} from "../../static-helpers/pagingHelpers.js"; +import { getLongRunningPoller } from "../../static-helpers/pollingHelpers.js"; +import { expandUrlTemplate } from "../../static-helpers/urlTemplate.js"; +import { + LogicalNetworksListAllOptionalParams, + LogicalNetworksListByResourceGroupOptionalParams, + LogicalNetworksDeleteOptionalParams, + LogicalNetworksUpdateOptionalParams, + LogicalNetworksCreateOrUpdateOptionalParams, + LogicalNetworksGetOptionalParams, +} from "./options.js"; +import { + StreamableMethod, + PathUncheckedResponse, + createRestError, + operationOptionsToRequestParameters, +} from "@azure-rest/core-client"; +import { PollerLike, OperationState } from "@azure/core-lro"; + +export function _listAllSend( + context: Client, + options: LogicalNetworksListAllOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/providers/Microsoft.AzureStackHCI/logicalNetworks{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).get({ + ...operationOptionsToRequestParameters(options), + headers: { + accept: "application/json", + ...options.requestOptions?.headers, + }, + }); +} + +export async function _listAllDeserialize( + result: PathUncheckedResponse, +): Promise<_LogicalNetworkListResult> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return _logicalNetworkListResultDeserializer(result.body); +} + +/** Lists all of the logical networks in the specified subscription. Use the nextLink property in the response to get the next page of logical networks. */ +export function listAll( + context: Client, + options: LogicalNetworksListAllOptionalParams = { requestOptions: {} }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _listAllSend(context, options), + _listAllDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink" }, + ); +} + +export function _listByResourceGroupSend( + context: Client, + resourceGroupName: string, + options: LogicalNetworksListByResourceGroupOptionalParams = { + requestOptions: {}, + }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/logicalNetworks{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).get({ + ...operationOptionsToRequestParameters(options), + headers: { + accept: "application/json", + ...options.requestOptions?.headers, + }, + }); +} + +export async function _listByResourceGroupDeserialize( + result: PathUncheckedResponse, +): Promise<_LogicalNetworkListResult> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return _logicalNetworkListResultDeserializer(result.body); +} + +/** Lists all of the logical networks in the specified resource group. Use the nextLink property in the response to get the next page of logical networks. */ +export function listByResourceGroup( + context: Client, + resourceGroupName: string, + options: LogicalNetworksListByResourceGroupOptionalParams = { + requestOptions: {}, + }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _listByResourceGroupSend(context, resourceGroupName, options), + _listByResourceGroupDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink" }, + ); +} + +export function _$deleteSend( + context: Client, + resourceGroupName: string, + logicalNetworkName: string, + options: LogicalNetworksDeleteOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/logicalNetworks/{logicalNetworkName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + logicalNetworkName: logicalNetworkName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).delete({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _$deleteDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["202", "204", "200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return; +} + +/** The operation to delete a logical network. */ +/** + * @fixme delete is a reserved word that cannot be used as an operation name. + * Please add @clientName("clientName") or @clientName("", "javascript") + * to the operation to override the generated name. + */ +export function $delete( + context: Client, + resourceGroupName: string, + logicalNetworkName: string, + options: LogicalNetworksDeleteOptionalParams = { requestOptions: {} }, +): PollerLike, void> { + return getLongRunningPoller(context, _$deleteDeserialize, ["202", "204", "200"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => _$deleteSend(context, resourceGroupName, logicalNetworkName, options), + resourceLocationConfig: "location", + }) as PollerLike, void>; +} + +export function _updateSend( + context: Client, + resourceGroupName: string, + logicalNetworkName: string, + properties: LogicalNetworksUpdateRequest, + options: LogicalNetworksUpdateOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/logicalNetworks/{logicalNetworkName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + logicalNetworkName: logicalNetworkName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).patch({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { + accept: "application/json", + ...options.requestOptions?.headers, + }, + body: logicalNetworksUpdateRequestSerializer(properties), + }); +} + +export async function _updateDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["200", "202"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return logicalNetworkDeserializer(result.body); +} + +/** The operation to update a logical network. */ +export function update( + context: Client, + resourceGroupName: string, + logicalNetworkName: string, + properties: LogicalNetworksUpdateRequest, + options: LogicalNetworksUpdateOptionalParams = { requestOptions: {} }, +): PollerLike, LogicalNetwork> { + return getLongRunningPoller(context, _updateDeserialize, ["200", "202"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _updateSend(context, resourceGroupName, logicalNetworkName, properties, options), + resourceLocationConfig: "location", + }) as PollerLike, LogicalNetwork>; +} + +export function _createOrUpdateSend( + context: Client, + resourceGroupName: string, + logicalNetworkName: string, + resource: LogicalNetwork, + options: LogicalNetworksCreateOrUpdateOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/logicalNetworks/{logicalNetworkName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + logicalNetworkName: logicalNetworkName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).put({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { + accept: "application/json", + ...options.requestOptions?.headers, + }, + body: logicalNetworkSerializer(resource), + }); +} + +export async function _createOrUpdateDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200", "201", "202"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return logicalNetworkDeserializer(result.body); +} + +/** The operation to create or update a logical network. Please note some properties can be set only during logical network creation. */ +export function createOrUpdate( + context: Client, + resourceGroupName: string, + logicalNetworkName: string, + resource: LogicalNetwork, + options: LogicalNetworksCreateOrUpdateOptionalParams = { requestOptions: {} }, +): PollerLike, LogicalNetwork> { + return getLongRunningPoller(context, _createOrUpdateDeserialize, ["200", "201", "202"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _createOrUpdateSend(context, resourceGroupName, logicalNetworkName, resource, options), + resourceLocationConfig: "azure-async-operation", + }) as PollerLike, LogicalNetwork>; +} + +export function _getSend( + context: Client, + resourceGroupName: string, + logicalNetworkName: string, + options: LogicalNetworksGetOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/logicalNetworks/{logicalNetworkName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + logicalNetworkName: logicalNetworkName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).get({ + ...operationOptionsToRequestParameters(options), + headers: { + accept: "application/json", + ...options.requestOptions?.headers, + }, + }); +} + +export async function _getDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return logicalNetworkDeserializer(result.body); +} + +/** The operation to get a logical network. */ +export async function get( + context: Client, + resourceGroupName: string, + logicalNetworkName: string, + options: LogicalNetworksGetOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _getSend(context, resourceGroupName, logicalNetworkName, options); + return _getDeserialize(result); +} diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/src/api/logicalNetworks/options.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/src/api/logicalNetworks/options.ts new file mode 100644 index 000000000000..fa7c1d2a9f06 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/src/api/logicalNetworks/options.ts @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { OperationOptions } from "@azure-rest/core-client"; + +/** Optional parameters. */ +export interface LogicalNetworksListAllOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface LogicalNetworksListByResourceGroupOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface LogicalNetworksDeleteOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface LogicalNetworksUpdateOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface LogicalNetworksCreateOrUpdateOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface LogicalNetworksGetOptionalParams extends OperationOptions {} diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/src/api/marketplaceGalleryImages/index.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/src/api/marketplaceGalleryImages/index.ts new file mode 100644 index 000000000000..9c96fd7a1f8b --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/src/api/marketplaceGalleryImages/index.ts @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { + listAll, + listByResourceGroup, + $delete, + update, + createOrUpdate, + get, +} from "./operations.js"; +export { + MarketplaceGalleryImagesListAllOptionalParams, + MarketplaceGalleryImagesListByResourceGroupOptionalParams, + MarketplaceGalleryImagesDeleteOptionalParams, + MarketplaceGalleryImagesUpdateOptionalParams, + MarketplaceGalleryImagesCreateOrUpdateOptionalParams, + MarketplaceGalleryImagesGetOptionalParams, +} from "./options.js"; diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/src/api/marketplaceGalleryImages/operations.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/src/api/marketplaceGalleryImages/operations.ts new file mode 100644 index 000000000000..7b2233aec870 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/src/api/marketplaceGalleryImages/operations.ts @@ -0,0 +1,388 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { AzureStackHCIVMManagementContext as Client } from "../index.js"; +import { + errorResponseDeserializer, + MarketplaceGalleryImage, + marketplaceGalleryImageSerializer, + marketplaceGalleryImageDeserializer, + MarketplaceGalleryImageTagsUpdate, + marketplaceGalleryImageTagsUpdateSerializer, + _MarketplaceGalleryImageListResult, + _marketplaceGalleryImageListResultDeserializer, +} from "../../models/models.js"; +import { + PagedAsyncIterableIterator, + buildPagedAsyncIterator, +} from "../../static-helpers/pagingHelpers.js"; +import { getLongRunningPoller } from "../../static-helpers/pollingHelpers.js"; +import { expandUrlTemplate } from "../../static-helpers/urlTemplate.js"; +import { + MarketplaceGalleryImagesListAllOptionalParams, + MarketplaceGalleryImagesListByResourceGroupOptionalParams, + MarketplaceGalleryImagesDeleteOptionalParams, + MarketplaceGalleryImagesUpdateOptionalParams, + MarketplaceGalleryImagesCreateOrUpdateOptionalParams, + MarketplaceGalleryImagesGetOptionalParams, +} from "./options.js"; +import { + StreamableMethod, + PathUncheckedResponse, + createRestError, + operationOptionsToRequestParameters, +} from "@azure-rest/core-client"; +import { PollerLike, OperationState } from "@azure/core-lro"; + +export function _listAllSend( + context: Client, + options: MarketplaceGalleryImagesListAllOptionalParams = { + requestOptions: {}, + }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/providers/Microsoft.AzureStackHCI/marketplaceGalleryImages{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).get({ + ...operationOptionsToRequestParameters(options), + headers: { + accept: "application/json", + ...options.requestOptions?.headers, + }, + }); +} + +export async function _listAllDeserialize( + result: PathUncheckedResponse, +): Promise<_MarketplaceGalleryImageListResult> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return _marketplaceGalleryImageListResultDeserializer(result.body); +} + +/** Lists all of the marketplace gallery images in the specified subscription. Use the nextLink property in the response to get the next page of marketplace gallery images. */ +export function listAll( + context: Client, + options: MarketplaceGalleryImagesListAllOptionalParams = { + requestOptions: {}, + }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _listAllSend(context, options), + _listAllDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink" }, + ); +} + +export function _listByResourceGroupSend( + context: Client, + resourceGroupName: string, + options: MarketplaceGalleryImagesListByResourceGroupOptionalParams = { + requestOptions: {}, + }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/marketplaceGalleryImages{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).get({ + ...operationOptionsToRequestParameters(options), + headers: { + accept: "application/json", + ...options.requestOptions?.headers, + }, + }); +} + +export async function _listByResourceGroupDeserialize( + result: PathUncheckedResponse, +): Promise<_MarketplaceGalleryImageListResult> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return _marketplaceGalleryImageListResultDeserializer(result.body); +} + +/** Lists all of the marketplace gallery images in the specified resource group. Use the nextLink property in the response to get the next page of marketplace gallery images. */ +export function listByResourceGroup( + context: Client, + resourceGroupName: string, + options: MarketplaceGalleryImagesListByResourceGroupOptionalParams = { + requestOptions: {}, + }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _listByResourceGroupSend(context, resourceGroupName, options), + _listByResourceGroupDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink" }, + ); +} + +export function _$deleteSend( + context: Client, + resourceGroupName: string, + marketplaceGalleryImageName: string, + options: MarketplaceGalleryImagesDeleteOptionalParams = { + requestOptions: {}, + }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/marketplaceGalleryImages/{marketplaceGalleryImageName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + marketplaceGalleryImageName: marketplaceGalleryImageName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).delete({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _$deleteDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["202", "204", "200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return; +} + +/** The operation to delete a marketplace gallery image. */ +/** + * @fixme delete is a reserved word that cannot be used as an operation name. + * Please add @clientName("clientName") or @clientName("", "javascript") + * to the operation to override the generated name. + */ +export function $delete( + context: Client, + resourceGroupName: string, + marketplaceGalleryImageName: string, + options: MarketplaceGalleryImagesDeleteOptionalParams = { + requestOptions: {}, + }, +): PollerLike, void> { + return getLongRunningPoller(context, _$deleteDeserialize, ["202", "204", "200"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _$deleteSend(context, resourceGroupName, marketplaceGalleryImageName, options), + resourceLocationConfig: "location", + }) as PollerLike, void>; +} + +export function _updateSend( + context: Client, + resourceGroupName: string, + marketplaceGalleryImageName: string, + properties: MarketplaceGalleryImageTagsUpdate, + options: MarketplaceGalleryImagesUpdateOptionalParams = { + requestOptions: {}, + }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/marketplaceGalleryImages/{marketplaceGalleryImageName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + marketplaceGalleryImageName: marketplaceGalleryImageName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).patch({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { + accept: "application/json", + ...options.requestOptions?.headers, + }, + body: marketplaceGalleryImageTagsUpdateSerializer(properties), + }); +} + +export async function _updateDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200", "202"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return marketplaceGalleryImageDeserializer(result.body); +} + +/** The operation to update a marketplace gallery image. */ +export function update( + context: Client, + resourceGroupName: string, + marketplaceGalleryImageName: string, + properties: MarketplaceGalleryImageTagsUpdate, + options: MarketplaceGalleryImagesUpdateOptionalParams = { + requestOptions: {}, + }, +): PollerLike, MarketplaceGalleryImage> { + return getLongRunningPoller(context, _updateDeserialize, ["200", "202"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _updateSend(context, resourceGroupName, marketplaceGalleryImageName, properties, options), + resourceLocationConfig: "location", + }) as PollerLike, MarketplaceGalleryImage>; +} + +export function _createOrUpdateSend( + context: Client, + resourceGroupName: string, + marketplaceGalleryImageName: string, + resource: MarketplaceGalleryImage, + options: MarketplaceGalleryImagesCreateOrUpdateOptionalParams = { + requestOptions: {}, + }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/marketplaceGalleryImages/{marketplaceGalleryImageName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + marketplaceGalleryImageName: marketplaceGalleryImageName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).put({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { + accept: "application/json", + ...options.requestOptions?.headers, + }, + body: marketplaceGalleryImageSerializer(resource), + }); +} + +export async function _createOrUpdateDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200", "201", "202"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return marketplaceGalleryImageDeserializer(result.body); +} + +/** The operation to create or update a marketplace gallery image. Please note some properties can be set only during marketplace gallery image creation. */ +export function createOrUpdate( + context: Client, + resourceGroupName: string, + marketplaceGalleryImageName: string, + resource: MarketplaceGalleryImage, + options: MarketplaceGalleryImagesCreateOrUpdateOptionalParams = { + requestOptions: {}, + }, +): PollerLike, MarketplaceGalleryImage> { + return getLongRunningPoller(context, _createOrUpdateDeserialize, ["200", "201", "202"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _createOrUpdateSend( + context, + resourceGroupName, + marketplaceGalleryImageName, + resource, + options, + ), + resourceLocationConfig: "azure-async-operation", + }) as PollerLike, MarketplaceGalleryImage>; +} + +export function _getSend( + context: Client, + resourceGroupName: string, + marketplaceGalleryImageName: string, + options: MarketplaceGalleryImagesGetOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/marketplaceGalleryImages/{marketplaceGalleryImageName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + marketplaceGalleryImageName: marketplaceGalleryImageName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).get({ + ...operationOptionsToRequestParameters(options), + headers: { + accept: "application/json", + ...options.requestOptions?.headers, + }, + }); +} + +export async function _getDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return marketplaceGalleryImageDeserializer(result.body); +} + +/** Gets a marketplace gallery image */ +export async function get( + context: Client, + resourceGroupName: string, + marketplaceGalleryImageName: string, + options: MarketplaceGalleryImagesGetOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _getSend(context, resourceGroupName, marketplaceGalleryImageName, options); + return _getDeserialize(result); +} diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/src/api/marketplaceGalleryImages/options.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/src/api/marketplaceGalleryImages/options.ts new file mode 100644 index 000000000000..7eb931f7fc17 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/src/api/marketplaceGalleryImages/options.ts @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { OperationOptions } from "@azure-rest/core-client"; + +/** Optional parameters. */ +export interface MarketplaceGalleryImagesListAllOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface MarketplaceGalleryImagesListByResourceGroupOptionalParams + extends OperationOptions {} + +/** Optional parameters. */ +export interface MarketplaceGalleryImagesDeleteOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface MarketplaceGalleryImagesUpdateOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface MarketplaceGalleryImagesCreateOrUpdateOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface MarketplaceGalleryImagesGetOptionalParams extends OperationOptions {} diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/src/api/networkInterfaces/index.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/src/api/networkInterfaces/index.ts new file mode 100644 index 000000000000..7da86f3177c9 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/src/api/networkInterfaces/index.ts @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { + listAll, + listByResourceGroup, + $delete, + update, + createOrUpdate, + get, +} from "./operations.js"; +export { + NetworkInterfacesListAllOptionalParams, + NetworkInterfacesListByResourceGroupOptionalParams, + NetworkInterfacesDeleteOptionalParams, + NetworkInterfacesUpdateOptionalParams, + NetworkInterfacesCreateOrUpdateOptionalParams, + NetworkInterfacesGetOptionalParams, +} from "./options.js"; diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/src/api/networkInterfaces/operations.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/src/api/networkInterfaces/operations.ts new file mode 100644 index 000000000000..9a62348c58c3 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/src/api/networkInterfaces/operations.ts @@ -0,0 +1,366 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { AzureStackHCIVMManagementContext as Client } from "../index.js"; +import { + errorResponseDeserializer, + NetworkInterface, + networkInterfaceSerializer, + networkInterfaceDeserializer, + NetworkInterfacesUpdateRequest, + networkInterfacesUpdateRequestSerializer, + _NetworkInterfaceListResult, + _networkInterfaceListResultDeserializer, +} from "../../models/models.js"; +import { + PagedAsyncIterableIterator, + buildPagedAsyncIterator, +} from "../../static-helpers/pagingHelpers.js"; +import { getLongRunningPoller } from "../../static-helpers/pollingHelpers.js"; +import { expandUrlTemplate } from "../../static-helpers/urlTemplate.js"; +import { + NetworkInterfacesListAllOptionalParams, + NetworkInterfacesListByResourceGroupOptionalParams, + NetworkInterfacesDeleteOptionalParams, + NetworkInterfacesUpdateOptionalParams, + NetworkInterfacesCreateOrUpdateOptionalParams, + NetworkInterfacesGetOptionalParams, +} from "./options.js"; +import { + StreamableMethod, + PathUncheckedResponse, + createRestError, + operationOptionsToRequestParameters, +} from "@azure-rest/core-client"; +import { PollerLike, OperationState } from "@azure/core-lro"; + +export function _listAllSend( + context: Client, + options: NetworkInterfacesListAllOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/providers/Microsoft.AzureStackHCI/networkInterfaces{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).get({ + ...operationOptionsToRequestParameters(options), + headers: { + accept: "application/json", + ...options.requestOptions?.headers, + }, + }); +} + +export async function _listAllDeserialize( + result: PathUncheckedResponse, +): Promise<_NetworkInterfaceListResult> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return _networkInterfaceListResultDeserializer(result.body); +} + +/** Lists all of the network interfaces in the specified subscription. Use the nextLink property in the response to get the next page of network interfaces. */ +export function listAll( + context: Client, + options: NetworkInterfacesListAllOptionalParams = { requestOptions: {} }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _listAllSend(context, options), + _listAllDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink" }, + ); +} + +export function _listByResourceGroupSend( + context: Client, + resourceGroupName: string, + options: NetworkInterfacesListByResourceGroupOptionalParams = { + requestOptions: {}, + }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/networkInterfaces{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).get({ + ...operationOptionsToRequestParameters(options), + headers: { + accept: "application/json", + ...options.requestOptions?.headers, + }, + }); +} + +export async function _listByResourceGroupDeserialize( + result: PathUncheckedResponse, +): Promise<_NetworkInterfaceListResult> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return _networkInterfaceListResultDeserializer(result.body); +} + +/** Lists all of the network interfaces in the specified resource group. Use the nextLink property in the response to get the next page of network interfaces. */ +export function listByResourceGroup( + context: Client, + resourceGroupName: string, + options: NetworkInterfacesListByResourceGroupOptionalParams = { + requestOptions: {}, + }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _listByResourceGroupSend(context, resourceGroupName, options), + _listByResourceGroupDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink" }, + ); +} + +export function _$deleteSend( + context: Client, + resourceGroupName: string, + networkInterfaceName: string, + options: NetworkInterfacesDeleteOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/networkInterfaces/{networkInterfaceName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + networkInterfaceName: networkInterfaceName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).delete({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _$deleteDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["202", "204", "200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return; +} + +/** The operation to delete a network interface. */ +/** + * @fixme delete is a reserved word that cannot be used as an operation name. + * Please add @clientName("clientName") or @clientName("", "javascript") + * to the operation to override the generated name. + */ +export function $delete( + context: Client, + resourceGroupName: string, + networkInterfaceName: string, + options: NetworkInterfacesDeleteOptionalParams = { requestOptions: {} }, +): PollerLike, void> { + return getLongRunningPoller(context, _$deleteDeserialize, ["202", "204", "200"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _$deleteSend(context, resourceGroupName, networkInterfaceName, options), + resourceLocationConfig: "location", + }) as PollerLike, void>; +} + +export function _updateSend( + context: Client, + resourceGroupName: string, + networkInterfaceName: string, + properties: NetworkInterfacesUpdateRequest, + options: NetworkInterfacesUpdateOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/networkInterfaces/{networkInterfaceName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + networkInterfaceName: networkInterfaceName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).patch({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { + accept: "application/json", + ...options.requestOptions?.headers, + }, + body: networkInterfacesUpdateRequestSerializer(properties), + }); +} + +export async function _updateDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["200", "202"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return networkInterfaceDeserializer(result.body); +} + +/** The operation to update a network interface. */ +export function update( + context: Client, + resourceGroupName: string, + networkInterfaceName: string, + properties: NetworkInterfacesUpdateRequest, + options: NetworkInterfacesUpdateOptionalParams = { requestOptions: {} }, +): PollerLike, NetworkInterface> { + return getLongRunningPoller(context, _updateDeserialize, ["200", "202"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _updateSend(context, resourceGroupName, networkInterfaceName, properties, options), + resourceLocationConfig: "location", + }) as PollerLike, NetworkInterface>; +} + +export function _createOrUpdateSend( + context: Client, + resourceGroupName: string, + networkInterfaceName: string, + resource: NetworkInterface, + options: NetworkInterfacesCreateOrUpdateOptionalParams = { + requestOptions: {}, + }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/networkInterfaces/{networkInterfaceName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + networkInterfaceName: networkInterfaceName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).put({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { + accept: "application/json", + ...options.requestOptions?.headers, + }, + body: networkInterfaceSerializer(resource), + }); +} + +export async function _createOrUpdateDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200", "201", "202"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return networkInterfaceDeserializer(result.body); +} + +/** The operation to create or update a network interface. Please note some properties can be set only during network interface creation. */ +export function createOrUpdate( + context: Client, + resourceGroupName: string, + networkInterfaceName: string, + resource: NetworkInterface, + options: NetworkInterfacesCreateOrUpdateOptionalParams = { + requestOptions: {}, + }, +): PollerLike, NetworkInterface> { + return getLongRunningPoller(context, _createOrUpdateDeserialize, ["200", "201", "202"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _createOrUpdateSend(context, resourceGroupName, networkInterfaceName, resource, options), + resourceLocationConfig: "azure-async-operation", + }) as PollerLike, NetworkInterface>; +} + +export function _getSend( + context: Client, + resourceGroupName: string, + networkInterfaceName: string, + options: NetworkInterfacesGetOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/networkInterfaces/{networkInterfaceName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + networkInterfaceName: networkInterfaceName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).get({ + ...operationOptionsToRequestParameters(options), + headers: { + accept: "application/json", + ...options.requestOptions?.headers, + }, + }); +} + +export async function _getDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return networkInterfaceDeserializer(result.body); +} + +/** Gets a network interface */ +export async function get( + context: Client, + resourceGroupName: string, + networkInterfaceName: string, + options: NetworkInterfacesGetOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _getSend(context, resourceGroupName, networkInterfaceName, options); + return _getDeserialize(result); +} diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/src/api/networkInterfaces/options.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/src/api/networkInterfaces/options.ts new file mode 100644 index 000000000000..a3a345addd02 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/src/api/networkInterfaces/options.ts @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { OperationOptions } from "@azure-rest/core-client"; + +/** Optional parameters. */ +export interface NetworkInterfacesListAllOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface NetworkInterfacesListByResourceGroupOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface NetworkInterfacesDeleteOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface NetworkInterfacesUpdateOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface NetworkInterfacesCreateOrUpdateOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface NetworkInterfacesGetOptionalParams extends OperationOptions {} diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/src/api/networkSecurityGroups/index.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/src/api/networkSecurityGroups/index.ts new file mode 100644 index 000000000000..d5b5383cdc1d --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/src/api/networkSecurityGroups/index.ts @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { + listAll, + listByResourceGroup, + $delete, + updateTags, + createOrUpdate, + get, +} from "./operations.js"; +export { + NetworkSecurityGroupsListAllOptionalParams, + NetworkSecurityGroupsListByResourceGroupOptionalParams, + NetworkSecurityGroupsDeleteOptionalParams, + NetworkSecurityGroupsUpdateTagsOptionalParams, + NetworkSecurityGroupsCreateOrUpdateOptionalParams, + NetworkSecurityGroupsGetOptionalParams, +} from "./options.js"; diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/src/api/networkSecurityGroups/operations.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/src/api/networkSecurityGroups/operations.ts new file mode 100644 index 000000000000..a9da62041f4f --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/src/api/networkSecurityGroups/operations.ts @@ -0,0 +1,374 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { AzureStackHCIVMManagementContext as Client } from "../index.js"; +import { + errorResponseDeserializer, + NetworkSecurityGroup, + networkSecurityGroupSerializer, + networkSecurityGroupDeserializer, + NetworkSecurityGroupTagsUpdate, + networkSecurityGroupTagsUpdateSerializer, + _NetworkSecurityGroupListResult, + _networkSecurityGroupListResultDeserializer, +} from "../../models/models.js"; +import { + PagedAsyncIterableIterator, + buildPagedAsyncIterator, +} from "../../static-helpers/pagingHelpers.js"; +import { getLongRunningPoller } from "../../static-helpers/pollingHelpers.js"; +import { expandUrlTemplate } from "../../static-helpers/urlTemplate.js"; +import { + NetworkSecurityGroupsListAllOptionalParams, + NetworkSecurityGroupsListByResourceGroupOptionalParams, + NetworkSecurityGroupsDeleteOptionalParams, + NetworkSecurityGroupsUpdateTagsOptionalParams, + NetworkSecurityGroupsCreateOrUpdateOptionalParams, + NetworkSecurityGroupsGetOptionalParams, +} from "./options.js"; +import { + StreamableMethod, + PathUncheckedResponse, + createRestError, + operationOptionsToRequestParameters, +} from "@azure-rest/core-client"; +import { PollerLike, OperationState } from "@azure/core-lro"; + +export function _listAllSend( + context: Client, + options: NetworkSecurityGroupsListAllOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/providers/Microsoft.AzureStackHCI/networkSecurityGroups{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).get({ + ...operationOptionsToRequestParameters(options), + headers: { + accept: "application/json", + ...options.requestOptions?.headers, + }, + }); +} + +export async function _listAllDeserialize( + result: PathUncheckedResponse, +): Promise<_NetworkSecurityGroupListResult> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return _networkSecurityGroupListResultDeserializer(result.body); +} + +/** Gets all network security groups in a subscription. */ +export function listAll( + context: Client, + options: NetworkSecurityGroupsListAllOptionalParams = { requestOptions: {} }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _listAllSend(context, options), + _listAllDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink" }, + ); +} + +export function _listByResourceGroupSend( + context: Client, + resourceGroupName: string, + options: NetworkSecurityGroupsListByResourceGroupOptionalParams = { + requestOptions: {}, + }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/networkSecurityGroups{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).get({ + ...operationOptionsToRequestParameters(options), + headers: { + accept: "application/json", + ...options.requestOptions?.headers, + }, + }); +} + +export async function _listByResourceGroupDeserialize( + result: PathUncheckedResponse, +): Promise<_NetworkSecurityGroupListResult> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return _networkSecurityGroupListResultDeserializer(result.body); +} + +/** Gets all network security groups in a resource group. */ +export function listByResourceGroup( + context: Client, + resourceGroupName: string, + options: NetworkSecurityGroupsListByResourceGroupOptionalParams = { + requestOptions: {}, + }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _listByResourceGroupSend(context, resourceGroupName, options), + _listByResourceGroupDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink" }, + ); +} + +export function _$deleteSend( + context: Client, + resourceGroupName: string, + networkSecurityGroupName: string, + options: NetworkSecurityGroupsDeleteOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/networkSecurityGroups/{networkSecurityGroupName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + networkSecurityGroupName: networkSecurityGroupName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).delete({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _$deleteDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["202", "204", "200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return; +} + +/** Deletes the specified network security group. */ +/** + * @fixme delete is a reserved word that cannot be used as an operation name. + * Please add @clientName("clientName") or @clientName("", "javascript") + * to the operation to override the generated name. + */ +export function $delete( + context: Client, + resourceGroupName: string, + networkSecurityGroupName: string, + options: NetworkSecurityGroupsDeleteOptionalParams = { requestOptions: {} }, +): PollerLike, void> { + return getLongRunningPoller(context, _$deleteDeserialize, ["202", "204", "200"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _$deleteSend(context, resourceGroupName, networkSecurityGroupName, options), + resourceLocationConfig: "location", + }) as PollerLike, void>; +} + +export function _updateTagsSend( + context: Client, + resourceGroupName: string, + networkSecurityGroupName: string, + properties: NetworkSecurityGroupTagsUpdate, + options: NetworkSecurityGroupsUpdateTagsOptionalParams = { + requestOptions: {}, + }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/networkSecurityGroups/{networkSecurityGroupName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + networkSecurityGroupName: networkSecurityGroupName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).patch({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { + accept: "application/json", + ...options.requestOptions?.headers, + }, + body: networkSecurityGroupTagsUpdateSerializer(properties), + }); +} + +export async function _updateTagsDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200", "202"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return networkSecurityGroupDeserializer(result.body); +} + +/** Updates a network security group tags. */ +export function updateTags( + context: Client, + resourceGroupName: string, + networkSecurityGroupName: string, + properties: NetworkSecurityGroupTagsUpdate, + options: NetworkSecurityGroupsUpdateTagsOptionalParams = { + requestOptions: {}, + }, +): PollerLike, NetworkSecurityGroup> { + return getLongRunningPoller(context, _updateTagsDeserialize, ["200", "202"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _updateTagsSend(context, resourceGroupName, networkSecurityGroupName, properties, options), + resourceLocationConfig: "location", + }) as PollerLike, NetworkSecurityGroup>; +} + +export function _createOrUpdateSend( + context: Client, + resourceGroupName: string, + networkSecurityGroupName: string, + resource: NetworkSecurityGroup, + options: NetworkSecurityGroupsCreateOrUpdateOptionalParams = { + requestOptions: {}, + }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/networkSecurityGroups/{networkSecurityGroupName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + networkSecurityGroupName: networkSecurityGroupName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).put({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { + accept: "application/json", + ...options.requestOptions?.headers, + }, + body: networkSecurityGroupSerializer(resource), + }); +} + +export async function _createOrUpdateDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200", "201", "202"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return networkSecurityGroupDeserializer(result.body); +} + +/** Creates or updates a network security group in the specified resource group. */ +export function createOrUpdate( + context: Client, + resourceGroupName: string, + networkSecurityGroupName: string, + resource: NetworkSecurityGroup, + options: NetworkSecurityGroupsCreateOrUpdateOptionalParams = { + requestOptions: {}, + }, +): PollerLike, NetworkSecurityGroup> { + return getLongRunningPoller(context, _createOrUpdateDeserialize, ["200", "201", "202"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _createOrUpdateSend(context, resourceGroupName, networkSecurityGroupName, resource, options), + resourceLocationConfig: "azure-async-operation", + }) as PollerLike, NetworkSecurityGroup>; +} + +export function _getSend( + context: Client, + resourceGroupName: string, + networkSecurityGroupName: string, + options: NetworkSecurityGroupsGetOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/networkSecurityGroups/{networkSecurityGroupName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + networkSecurityGroupName: networkSecurityGroupName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).get({ + ...operationOptionsToRequestParameters(options), + headers: { + accept: "application/json", + ...options.requestOptions?.headers, + }, + }); +} + +export async function _getDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return networkSecurityGroupDeserializer(result.body); +} + +/** Gets the specified network security group. */ +export async function get( + context: Client, + resourceGroupName: string, + networkSecurityGroupName: string, + options: NetworkSecurityGroupsGetOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _getSend(context, resourceGroupName, networkSecurityGroupName, options); + return _getDeserialize(result); +} diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/src/api/networkSecurityGroups/options.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/src/api/networkSecurityGroups/options.ts new file mode 100644 index 000000000000..106e1b88278e --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/src/api/networkSecurityGroups/options.ts @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { OperationOptions } from "@azure-rest/core-client"; + +/** Optional parameters. */ +export interface NetworkSecurityGroupsListAllOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface NetworkSecurityGroupsListByResourceGroupOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface NetworkSecurityGroupsDeleteOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface NetworkSecurityGroupsUpdateTagsOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface NetworkSecurityGroupsCreateOrUpdateOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface NetworkSecurityGroupsGetOptionalParams extends OperationOptions {} diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/src/api/securityRules/index.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/src/api/securityRules/index.ts new file mode 100644 index 000000000000..5d8dab7ab0c9 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/src/api/securityRules/index.ts @@ -0,0 +1,10 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { listByNetworkSecurityGroup, $delete, createOrUpdate, get } from "./operations.js"; +export { + SecurityRulesListByNetworkSecurityGroupOptionalParams, + SecurityRulesDeleteOptionalParams, + SecurityRulesCreateOrUpdateOptionalParams, + SecurityRulesGetOptionalParams, +} from "./options.js"; diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/src/api/securityRules/operations.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/src/api/securityRules/operations.ts new file mode 100644 index 000000000000..ec34a68d7770 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/src/api/securityRules/operations.ts @@ -0,0 +1,281 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { AzureStackHCIVMManagementContext as Client } from "../index.js"; +import { + errorResponseDeserializer, + SecurityRule, + securityRuleSerializer, + securityRuleDeserializer, + _SecurityRuleListResult, + _securityRuleListResultDeserializer, +} from "../../models/models.js"; +import { + PagedAsyncIterableIterator, + buildPagedAsyncIterator, +} from "../../static-helpers/pagingHelpers.js"; +import { getLongRunningPoller } from "../../static-helpers/pollingHelpers.js"; +import { expandUrlTemplate } from "../../static-helpers/urlTemplate.js"; +import { + SecurityRulesListByNetworkSecurityGroupOptionalParams, + SecurityRulesDeleteOptionalParams, + SecurityRulesCreateOrUpdateOptionalParams, + SecurityRulesGetOptionalParams, +} from "./options.js"; +import { + StreamableMethod, + PathUncheckedResponse, + createRestError, + operationOptionsToRequestParameters, +} from "@azure-rest/core-client"; +import { PollerLike, OperationState } from "@azure/core-lro"; + +export function _listByNetworkSecurityGroupSend( + context: Client, + resourceGroupName: string, + networkSecurityGroupName: string, + options: SecurityRulesListByNetworkSecurityGroupOptionalParams = { + requestOptions: {}, + }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/networkSecurityGroups/{networkSecurityGroupName}/securityRules{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + networkSecurityGroupName: networkSecurityGroupName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).get({ + ...operationOptionsToRequestParameters(options), + headers: { + accept: "application/json", + ...options.requestOptions?.headers, + }, + }); +} + +export async function _listByNetworkSecurityGroupDeserialize( + result: PathUncheckedResponse, +): Promise<_SecurityRuleListResult> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return _securityRuleListResultDeserializer(result.body); +} + +/** Gets all security rules in a Network Security Group. */ +export function listByNetworkSecurityGroup( + context: Client, + resourceGroupName: string, + networkSecurityGroupName: string, + options: SecurityRulesListByNetworkSecurityGroupOptionalParams = { + requestOptions: {}, + }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => + _listByNetworkSecurityGroupSend( + context, + resourceGroupName, + networkSecurityGroupName, + options, + ), + _listByNetworkSecurityGroupDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink" }, + ); +} + +export function _$deleteSend( + context: Client, + resourceGroupName: string, + networkSecurityGroupName: string, + securityRuleName: string, + options: SecurityRulesDeleteOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + networkSecurityGroupName: networkSecurityGroupName, + securityRuleName: securityRuleName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).delete({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _$deleteDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["202", "204", "200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return; +} + +/** Deletes the specified security rule. */ +/** + * @fixme delete is a reserved word that cannot be used as an operation name. + * Please add @clientName("clientName") or @clientName("", "javascript") + * to the operation to override the generated name. + */ +export function $delete( + context: Client, + resourceGroupName: string, + networkSecurityGroupName: string, + securityRuleName: string, + options: SecurityRulesDeleteOptionalParams = { requestOptions: {} }, +): PollerLike, void> { + return getLongRunningPoller(context, _$deleteDeserialize, ["202", "204", "200"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _$deleteSend(context, resourceGroupName, networkSecurityGroupName, securityRuleName, options), + resourceLocationConfig: "location", + }) as PollerLike, void>; +} + +export function _createOrUpdateSend( + context: Client, + resourceGroupName: string, + networkSecurityGroupName: string, + securityRuleName: string, + resource: SecurityRule, + options: SecurityRulesCreateOrUpdateOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + networkSecurityGroupName: networkSecurityGroupName, + securityRuleName: securityRuleName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).put({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { + accept: "application/json", + ...options.requestOptions?.headers, + }, + body: securityRuleSerializer(resource), + }); +} + +export async function _createOrUpdateDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200", "201", "202"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return securityRuleDeserializer(result.body); +} + +/** Creates or updates a security rule in the specified resource group. */ +export function createOrUpdate( + context: Client, + resourceGroupName: string, + networkSecurityGroupName: string, + securityRuleName: string, + resource: SecurityRule, + options: SecurityRulesCreateOrUpdateOptionalParams = { requestOptions: {} }, +): PollerLike, SecurityRule> { + return getLongRunningPoller(context, _createOrUpdateDeserialize, ["200", "201", "202"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _createOrUpdateSend( + context, + resourceGroupName, + networkSecurityGroupName, + securityRuleName, + resource, + options, + ), + resourceLocationConfig: "azure-async-operation", + }) as PollerLike, SecurityRule>; +} + +export function _getSend( + context: Client, + resourceGroupName: string, + networkSecurityGroupName: string, + securityRuleName: string, + options: SecurityRulesGetOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + networkSecurityGroupName: networkSecurityGroupName, + securityRuleName: securityRuleName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).get({ + ...operationOptionsToRequestParameters(options), + headers: { + accept: "application/json", + ...options.requestOptions?.headers, + }, + }); +} + +export async function _getDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return securityRuleDeserializer(result.body); +} + +/** Gets the specified security rule. */ +export async function get( + context: Client, + resourceGroupName: string, + networkSecurityGroupName: string, + securityRuleName: string, + options: SecurityRulesGetOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _getSend( + context, + resourceGroupName, + networkSecurityGroupName, + securityRuleName, + options, + ); + return _getDeserialize(result); +} diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/src/api/securityRules/options.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/src/api/securityRules/options.ts new file mode 100644 index 000000000000..de070c1f23b0 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/src/api/securityRules/options.ts @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { OperationOptions } from "@azure-rest/core-client"; + +/** Optional parameters. */ +export interface SecurityRulesListByNetworkSecurityGroupOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface SecurityRulesDeleteOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface SecurityRulesCreateOrUpdateOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface SecurityRulesGetOptionalParams extends OperationOptions {} diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/src/api/storageContainers/index.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/src/api/storageContainers/index.ts new file mode 100644 index 000000000000..506576228299 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/src/api/storageContainers/index.ts @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { + listAll, + listByResourceGroup, + $delete, + update, + createOrUpdate, + get, +} from "./operations.js"; +export { + StorageContainersListAllOptionalParams, + StorageContainersListByResourceGroupOptionalParams, + StorageContainersDeleteOptionalParams, + StorageContainersUpdateOptionalParams, + StorageContainersCreateOrUpdateOptionalParams, + StorageContainersGetOptionalParams, +} from "./options.js"; diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/src/api/storageContainers/operations.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/src/api/storageContainers/operations.ts new file mode 100644 index 000000000000..cff0b99ff349 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/src/api/storageContainers/operations.ts @@ -0,0 +1,366 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { AzureStackHCIVMManagementContext as Client } from "../index.js"; +import { + errorResponseDeserializer, + StorageContainer, + storageContainerSerializer, + storageContainerDeserializer, + StorageContainerTagsUpdate, + storageContainerTagsUpdateSerializer, + _StorageContainerListResult, + _storageContainerListResultDeserializer, +} from "../../models/models.js"; +import { + PagedAsyncIterableIterator, + buildPagedAsyncIterator, +} from "../../static-helpers/pagingHelpers.js"; +import { getLongRunningPoller } from "../../static-helpers/pollingHelpers.js"; +import { expandUrlTemplate } from "../../static-helpers/urlTemplate.js"; +import { + StorageContainersListAllOptionalParams, + StorageContainersListByResourceGroupOptionalParams, + StorageContainersDeleteOptionalParams, + StorageContainersUpdateOptionalParams, + StorageContainersCreateOrUpdateOptionalParams, + StorageContainersGetOptionalParams, +} from "./options.js"; +import { + StreamableMethod, + PathUncheckedResponse, + createRestError, + operationOptionsToRequestParameters, +} from "@azure-rest/core-client"; +import { PollerLike, OperationState } from "@azure/core-lro"; + +export function _listAllSend( + context: Client, + options: StorageContainersListAllOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/providers/Microsoft.AzureStackHCI/storageContainers{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).get({ + ...operationOptionsToRequestParameters(options), + headers: { + accept: "application/json", + ...options.requestOptions?.headers, + }, + }); +} + +export async function _listAllDeserialize( + result: PathUncheckedResponse, +): Promise<_StorageContainerListResult> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return _storageContainerListResultDeserializer(result.body); +} + +/** Lists all of the storage containers in the specified subscription. Use the nextLink property in the response to get the next page of storage containers. */ +export function listAll( + context: Client, + options: StorageContainersListAllOptionalParams = { requestOptions: {} }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _listAllSend(context, options), + _listAllDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink" }, + ); +} + +export function _listByResourceGroupSend( + context: Client, + resourceGroupName: string, + options: StorageContainersListByResourceGroupOptionalParams = { + requestOptions: {}, + }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/storageContainers{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).get({ + ...operationOptionsToRequestParameters(options), + headers: { + accept: "application/json", + ...options.requestOptions?.headers, + }, + }); +} + +export async function _listByResourceGroupDeserialize( + result: PathUncheckedResponse, +): Promise<_StorageContainerListResult> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return _storageContainerListResultDeserializer(result.body); +} + +/** Lists all of the storage containers in the specified resource group. Use the nextLink property in the response to get the next page of storage containers. */ +export function listByResourceGroup( + context: Client, + resourceGroupName: string, + options: StorageContainersListByResourceGroupOptionalParams = { + requestOptions: {}, + }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _listByResourceGroupSend(context, resourceGroupName, options), + _listByResourceGroupDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink" }, + ); +} + +export function _$deleteSend( + context: Client, + resourceGroupName: string, + storageContainerName: string, + options: StorageContainersDeleteOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/storageContainers/{storageContainerName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + storageContainerName: storageContainerName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).delete({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _$deleteDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["202", "204", "200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return; +} + +/** The operation to delete a storage container. */ +/** + * @fixme delete is a reserved word that cannot be used as an operation name. + * Please add @clientName("clientName") or @clientName("", "javascript") + * to the operation to override the generated name. + */ +export function $delete( + context: Client, + resourceGroupName: string, + storageContainerName: string, + options: StorageContainersDeleteOptionalParams = { requestOptions: {} }, +): PollerLike, void> { + return getLongRunningPoller(context, _$deleteDeserialize, ["202", "204", "200"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _$deleteSend(context, resourceGroupName, storageContainerName, options), + resourceLocationConfig: "location", + }) as PollerLike, void>; +} + +export function _updateSend( + context: Client, + resourceGroupName: string, + storageContainerName: string, + properties: StorageContainerTagsUpdate, + options: StorageContainersUpdateOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/storageContainers/{storageContainerName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + storageContainerName: storageContainerName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).patch({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { + accept: "application/json", + ...options.requestOptions?.headers, + }, + body: storageContainerTagsUpdateSerializer(properties), + }); +} + +export async function _updateDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["200", "202"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return storageContainerDeserializer(result.body); +} + +/** The operation to update a storage container. */ +export function update( + context: Client, + resourceGroupName: string, + storageContainerName: string, + properties: StorageContainerTagsUpdate, + options: StorageContainersUpdateOptionalParams = { requestOptions: {} }, +): PollerLike, StorageContainer> { + return getLongRunningPoller(context, _updateDeserialize, ["200", "202"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _updateSend(context, resourceGroupName, storageContainerName, properties, options), + resourceLocationConfig: "location", + }) as PollerLike, StorageContainer>; +} + +export function _createOrUpdateSend( + context: Client, + resourceGroupName: string, + storageContainerName: string, + resource: StorageContainer, + options: StorageContainersCreateOrUpdateOptionalParams = { + requestOptions: {}, + }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/storageContainers/{storageContainerName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + storageContainerName: storageContainerName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).put({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { + accept: "application/json", + ...options.requestOptions?.headers, + }, + body: storageContainerSerializer(resource), + }); +} + +export async function _createOrUpdateDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200", "201", "202"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return storageContainerDeserializer(result.body); +} + +/** The operation to create or update a storage container. Please note some properties can be set only during storage container creation. */ +export function createOrUpdate( + context: Client, + resourceGroupName: string, + storageContainerName: string, + resource: StorageContainer, + options: StorageContainersCreateOrUpdateOptionalParams = { + requestOptions: {}, + }, +): PollerLike, StorageContainer> { + return getLongRunningPoller(context, _createOrUpdateDeserialize, ["200", "201", "202"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _createOrUpdateSend(context, resourceGroupName, storageContainerName, resource, options), + resourceLocationConfig: "azure-async-operation", + }) as PollerLike, StorageContainer>; +} + +export function _getSend( + context: Client, + resourceGroupName: string, + storageContainerName: string, + options: StorageContainersGetOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/storageContainers/{storageContainerName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + storageContainerName: storageContainerName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).get({ + ...operationOptionsToRequestParameters(options), + headers: { + accept: "application/json", + ...options.requestOptions?.headers, + }, + }); +} + +export async function _getDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return storageContainerDeserializer(result.body); +} + +/** Gets a storage container */ +export async function get( + context: Client, + resourceGroupName: string, + storageContainerName: string, + options: StorageContainersGetOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _getSend(context, resourceGroupName, storageContainerName, options); + return _getDeserialize(result); +} diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/src/api/storageContainers/options.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/src/api/storageContainers/options.ts new file mode 100644 index 000000000000..fb3bf5f6249d --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/src/api/storageContainers/options.ts @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { OperationOptions } from "@azure-rest/core-client"; + +/** Optional parameters. */ +export interface StorageContainersListAllOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface StorageContainersListByResourceGroupOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface StorageContainersDeleteOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface StorageContainersUpdateOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface StorageContainersCreateOrUpdateOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface StorageContainersGetOptionalParams extends OperationOptions {} diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/src/api/virtualHardDisks/index.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/src/api/virtualHardDisks/index.ts new file mode 100644 index 000000000000..193bafee9d8e --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/src/api/virtualHardDisks/index.ts @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { + upload, + listAll, + listByResourceGroup, + $delete, + update, + createOrUpdate, + get, +} from "./operations.js"; +export { + VirtualHardDisksUploadOptionalParams, + VirtualHardDisksListAllOptionalParams, + VirtualHardDisksListByResourceGroupOptionalParams, + VirtualHardDisksDeleteOptionalParams, + VirtualHardDisksUpdateOptionalParams, + VirtualHardDisksCreateOrUpdateOptionalParams, + VirtualHardDisksGetOptionalParams, +} from "./options.js"; diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/src/api/virtualHardDisks/operations.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/src/api/virtualHardDisks/operations.ts new file mode 100644 index 000000000000..a35d74545154 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/src/api/virtualHardDisks/operations.ts @@ -0,0 +1,431 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { AzureStackHCIVMManagementContext as Client } from "../index.js"; +import { + errorResponseDeserializer, + VirtualHardDisk, + virtualHardDiskSerializer, + virtualHardDiskDeserializer, + VirtualHardDisksUpdateRequest, + virtualHardDisksUpdateRequestSerializer, + _VirtualHardDiskListResult, + _virtualHardDiskListResultDeserializer, + VirtualHardDiskUploadRequest, + virtualHardDiskUploadRequestSerializer, + VirtualHardDiskUploadResponse, + virtualHardDiskUploadResponseDeserializer, +} from "../../models/models.js"; +import { + PagedAsyncIterableIterator, + buildPagedAsyncIterator, +} from "../../static-helpers/pagingHelpers.js"; +import { getLongRunningPoller } from "../../static-helpers/pollingHelpers.js"; +import { expandUrlTemplate } from "../../static-helpers/urlTemplate.js"; +import { + VirtualHardDisksUploadOptionalParams, + VirtualHardDisksListAllOptionalParams, + VirtualHardDisksListByResourceGroupOptionalParams, + VirtualHardDisksDeleteOptionalParams, + VirtualHardDisksUpdateOptionalParams, + VirtualHardDisksCreateOrUpdateOptionalParams, + VirtualHardDisksGetOptionalParams, +} from "./options.js"; +import { + StreamableMethod, + PathUncheckedResponse, + createRestError, + operationOptionsToRequestParameters, +} from "@azure-rest/core-client"; +import { PollerLike, OperationState } from "@azure/core-lro"; + +export function _uploadSend( + context: Client, + resourceGroupName: string, + virtualHardDiskName: string, + body: VirtualHardDiskUploadRequest, + options: VirtualHardDisksUploadOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/virtualHardDisks/{virtualHardDiskName}/upload{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + virtualHardDiskName: virtualHardDiskName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).post({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { + accept: "application/json", + ...options.requestOptions?.headers, + }, + body: virtualHardDiskUploadRequestSerializer(body), + }); +} + +export async function _uploadDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["202", "200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return virtualHardDiskUploadResponseDeserializer(result.body); +} + +/** The operation to upload a virtual hard disk. */ +export function upload( + context: Client, + resourceGroupName: string, + virtualHardDiskName: string, + body: VirtualHardDiskUploadRequest, + options: VirtualHardDisksUploadOptionalParams = { requestOptions: {} }, +): PollerLike, VirtualHardDiskUploadResponse> { + return getLongRunningPoller(context, _uploadDeserialize, ["202", "200"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _uploadSend(context, resourceGroupName, virtualHardDiskName, body, options), + resourceLocationConfig: "location", + }) as PollerLike, VirtualHardDiskUploadResponse>; +} + +export function _listAllSend( + context: Client, + options: VirtualHardDisksListAllOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/providers/Microsoft.AzureStackHCI/virtualHardDisks{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).get({ + ...operationOptionsToRequestParameters(options), + headers: { + accept: "application/json", + ...options.requestOptions?.headers, + }, + }); +} + +export async function _listAllDeserialize( + result: PathUncheckedResponse, +): Promise<_VirtualHardDiskListResult> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return _virtualHardDiskListResultDeserializer(result.body); +} + +/** Lists all of the virtual hard disks in the specified subscription. Use the nextLink property in the response to get the next page of virtual hard disks. */ +export function listAll( + context: Client, + options: VirtualHardDisksListAllOptionalParams = { requestOptions: {} }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _listAllSend(context, options), + _listAllDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink" }, + ); +} + +export function _listByResourceGroupSend( + context: Client, + resourceGroupName: string, + options: VirtualHardDisksListByResourceGroupOptionalParams = { + requestOptions: {}, + }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/virtualHardDisks{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).get({ + ...operationOptionsToRequestParameters(options), + headers: { + accept: "application/json", + ...options.requestOptions?.headers, + }, + }); +} + +export async function _listByResourceGroupDeserialize( + result: PathUncheckedResponse, +): Promise<_VirtualHardDiskListResult> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return _virtualHardDiskListResultDeserializer(result.body); +} + +/** Lists all of the virtual hard disks in the specified resource group. Use the nextLink property in the response to get the next page of virtual hard disks. */ +export function listByResourceGroup( + context: Client, + resourceGroupName: string, + options: VirtualHardDisksListByResourceGroupOptionalParams = { + requestOptions: {}, + }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _listByResourceGroupSend(context, resourceGroupName, options), + _listByResourceGroupDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink" }, + ); +} + +export function _$deleteSend( + context: Client, + resourceGroupName: string, + virtualHardDiskName: string, + options: VirtualHardDisksDeleteOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/virtualHardDisks/{virtualHardDiskName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + virtualHardDiskName: virtualHardDiskName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).delete({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _$deleteDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["202", "204", "200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return; +} + +/** The operation to delete a virtual hard disk. */ +/** + * @fixme delete is a reserved word that cannot be used as an operation name. + * Please add @clientName("clientName") or @clientName("", "javascript") + * to the operation to override the generated name. + */ +export function $delete( + context: Client, + resourceGroupName: string, + virtualHardDiskName: string, + options: VirtualHardDisksDeleteOptionalParams = { requestOptions: {} }, +): PollerLike, void> { + return getLongRunningPoller(context, _$deleteDeserialize, ["202", "204", "200"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _$deleteSend(context, resourceGroupName, virtualHardDiskName, options), + resourceLocationConfig: "location", + }) as PollerLike, void>; +} + +export function _updateSend( + context: Client, + resourceGroupName: string, + virtualHardDiskName: string, + properties: VirtualHardDisksUpdateRequest, + options: VirtualHardDisksUpdateOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/virtualHardDisks/{virtualHardDiskName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + virtualHardDiskName: virtualHardDiskName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).patch({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { + accept: "application/json", + ...options.requestOptions?.headers, + }, + body: virtualHardDisksUpdateRequestSerializer(properties), + }); +} + +export async function _updateDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["200", "202"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return virtualHardDiskDeserializer(result.body); +} + +/** The operation to update a virtual hard disk. */ +export function update( + context: Client, + resourceGroupName: string, + virtualHardDiskName: string, + properties: VirtualHardDisksUpdateRequest, + options: VirtualHardDisksUpdateOptionalParams = { requestOptions: {} }, +): PollerLike, VirtualHardDisk> { + return getLongRunningPoller(context, _updateDeserialize, ["200", "202"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _updateSend(context, resourceGroupName, virtualHardDiskName, properties, options), + resourceLocationConfig: "location", + }) as PollerLike, VirtualHardDisk>; +} + +export function _createOrUpdateSend( + context: Client, + resourceGroupName: string, + virtualHardDiskName: string, + resource: VirtualHardDisk, + options: VirtualHardDisksCreateOrUpdateOptionalParams = { + requestOptions: {}, + }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/virtualHardDisks/{virtualHardDiskName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + virtualHardDiskName: virtualHardDiskName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).put({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { + accept: "application/json", + ...options.requestOptions?.headers, + }, + body: virtualHardDiskSerializer(resource), + }); +} + +export async function _createOrUpdateDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200", "201", "202"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return virtualHardDiskDeserializer(result.body); +} + +/** The operation to create or update a virtual hard disk. Please note some properties can be set only during virtual hard disk creation. */ +export function createOrUpdate( + context: Client, + resourceGroupName: string, + virtualHardDiskName: string, + resource: VirtualHardDisk, + options: VirtualHardDisksCreateOrUpdateOptionalParams = { + requestOptions: {}, + }, +): PollerLike, VirtualHardDisk> { + return getLongRunningPoller(context, _createOrUpdateDeserialize, ["200", "201", "202"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _createOrUpdateSend(context, resourceGroupName, virtualHardDiskName, resource, options), + resourceLocationConfig: "azure-async-operation", + }) as PollerLike, VirtualHardDisk>; +} + +export function _getSend( + context: Client, + resourceGroupName: string, + virtualHardDiskName: string, + options: VirtualHardDisksGetOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/virtualHardDisks/{virtualHardDiskName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + virtualHardDiskName: virtualHardDiskName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).get({ + ...operationOptionsToRequestParameters(options), + headers: { + accept: "application/json", + ...options.requestOptions?.headers, + }, + }); +} + +export async function _getDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return virtualHardDiskDeserializer(result.body); +} + +/** Gets a virtual hard disk */ +export async function get( + context: Client, + resourceGroupName: string, + virtualHardDiskName: string, + options: VirtualHardDisksGetOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _getSend(context, resourceGroupName, virtualHardDiskName, options); + return _getDeserialize(result); +} diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/src/api/virtualHardDisks/options.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/src/api/virtualHardDisks/options.ts new file mode 100644 index 000000000000..d2a78ea71444 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/src/api/virtualHardDisks/options.ts @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { OperationOptions } from "@azure-rest/core-client"; + +/** Optional parameters. */ +export interface VirtualHardDisksUploadOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface VirtualHardDisksListAllOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface VirtualHardDisksListByResourceGroupOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface VirtualHardDisksDeleteOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface VirtualHardDisksUpdateOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface VirtualHardDisksCreateOrUpdateOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface VirtualHardDisksGetOptionalParams extends OperationOptions {} diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/src/api/virtualMachineInstances/index.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/src/api/virtualMachineInstances/index.ts new file mode 100644 index 000000000000..17bc5e594855 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/src/api/virtualMachineInstances/index.ts @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { + save, + pause, + restart, + stop, + start, + list, + $delete, + update, + createOrUpdate, + get, +} from "./operations.js"; +export { + VirtualMachineInstancesSaveOptionalParams, + VirtualMachineInstancesPauseOptionalParams, + VirtualMachineInstancesRestartOptionalParams, + VirtualMachineInstancesStopOptionalParams, + VirtualMachineInstancesStartOptionalParams, + VirtualMachineInstancesListOptionalParams, + VirtualMachineInstancesDeleteOptionalParams, + VirtualMachineInstancesUpdateOptionalParams, + VirtualMachineInstancesCreateOrUpdateOptionalParams, + VirtualMachineInstancesGetOptionalParams, +} from "./options.js"; diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/src/api/virtualMachineInstances/operations.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/src/api/virtualMachineInstances/operations.ts new file mode 100644 index 000000000000..4a1e40eba0a5 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/src/api/virtualMachineInstances/operations.ts @@ -0,0 +1,519 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { AzureStackHCIVMManagementContext as Client } from "../index.js"; +import { + errorResponseDeserializer, + VirtualMachineInstance, + virtualMachineInstanceSerializer, + virtualMachineInstanceDeserializer, + VirtualMachineInstanceUpdateRequest, + virtualMachineInstanceUpdateRequestSerializer, + _VirtualMachineInstanceListResult, + _virtualMachineInstanceListResultDeserializer, +} from "../../models/models.js"; +import { + PagedAsyncIterableIterator, + buildPagedAsyncIterator, +} from "../../static-helpers/pagingHelpers.js"; +import { getLongRunningPoller } from "../../static-helpers/pollingHelpers.js"; +import { expandUrlTemplate } from "../../static-helpers/urlTemplate.js"; +import { + VirtualMachineInstancesSaveOptionalParams, + VirtualMachineInstancesPauseOptionalParams, + VirtualMachineInstancesRestartOptionalParams, + VirtualMachineInstancesStopOptionalParams, + VirtualMachineInstancesStartOptionalParams, + VirtualMachineInstancesListOptionalParams, + VirtualMachineInstancesDeleteOptionalParams, + VirtualMachineInstancesUpdateOptionalParams, + VirtualMachineInstancesCreateOrUpdateOptionalParams, + VirtualMachineInstancesGetOptionalParams, +} from "./options.js"; +import { + StreamableMethod, + PathUncheckedResponse, + createRestError, + operationOptionsToRequestParameters, +} from "@azure-rest/core-client"; +import { PollerLike, OperationState } from "@azure/core-lro"; + +export function _saveSend( + context: Client, + resourceUri: string, + options: VirtualMachineInstancesSaveOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/{+resourceUri}/providers/Microsoft.AzureStackHCI/virtualMachineInstances/default/save{?api%2Dversion}", + { + resourceUri: resourceUri, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).post({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _saveDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["202", "200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return; +} + +/** The operation to save a virtual machine instance. */ +export function save( + context: Client, + resourceUri: string, + options: VirtualMachineInstancesSaveOptionalParams = { requestOptions: {} }, +): PollerLike, void> { + return getLongRunningPoller(context, _saveDeserialize, ["202", "200"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => _saveSend(context, resourceUri, options), + resourceLocationConfig: "location", + }) as PollerLike, void>; +} + +export function _pauseSend( + context: Client, + resourceUri: string, + options: VirtualMachineInstancesPauseOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/{+resourceUri}/providers/Microsoft.AzureStackHCI/virtualMachineInstances/default/pause{?api%2Dversion}", + { + resourceUri: resourceUri, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).post({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _pauseDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["202", "200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return; +} + +/** The operation to pause a virtual machine instance. */ +export function pause( + context: Client, + resourceUri: string, + options: VirtualMachineInstancesPauseOptionalParams = { requestOptions: {} }, +): PollerLike, void> { + return getLongRunningPoller(context, _pauseDeserialize, ["202", "200"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => _pauseSend(context, resourceUri, options), + resourceLocationConfig: "location", + }) as PollerLike, void>; +} + +export function _restartSend( + context: Client, + resourceUri: string, + options: VirtualMachineInstancesRestartOptionalParams = { + requestOptions: {}, + }, +): StreamableMethod { + const path = expandUrlTemplate( + "/{+resourceUri}/providers/Microsoft.AzureStackHCI/virtualMachineInstances/default/restart{?api%2Dversion}", + { + resourceUri: resourceUri, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).post({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _restartDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["202", "200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return; +} + +/** The operation to restart a virtual machine instance. */ +export function restart( + context: Client, + resourceUri: string, + options: VirtualMachineInstancesRestartOptionalParams = { + requestOptions: {}, + }, +): PollerLike, void> { + return getLongRunningPoller(context, _restartDeserialize, ["202", "200"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => _restartSend(context, resourceUri, options), + resourceLocationConfig: "location", + }) as PollerLike, void>; +} + +export function _stopSend( + context: Client, + resourceUri: string, + options: VirtualMachineInstancesStopOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/{+resourceUri}/providers/Microsoft.AzureStackHCI/virtualMachineInstances/default/stop{?api%2Dversion}", + { + resourceUri: resourceUri, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).post({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _stopDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["202", "200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return; +} + +/** The operation to stop a virtual machine instance. */ +export function stop( + context: Client, + resourceUri: string, + options: VirtualMachineInstancesStopOptionalParams = { requestOptions: {} }, +): PollerLike, void> { + return getLongRunningPoller(context, _stopDeserialize, ["202", "200"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => _stopSend(context, resourceUri, options), + resourceLocationConfig: "location", + }) as PollerLike, void>; +} + +export function _startSend( + context: Client, + resourceUri: string, + options: VirtualMachineInstancesStartOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/{+resourceUri}/providers/Microsoft.AzureStackHCI/virtualMachineInstances/default/start{?api%2Dversion}", + { + resourceUri: resourceUri, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).post({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _startDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["202", "200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return; +} + +/** The operation to start a virtual machine instance. */ +export function start( + context: Client, + resourceUri: string, + options: VirtualMachineInstancesStartOptionalParams = { requestOptions: {} }, +): PollerLike, void> { + return getLongRunningPoller(context, _startDeserialize, ["202", "200"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => _startSend(context, resourceUri, options), + resourceLocationConfig: "location", + }) as PollerLike, void>; +} + +export function _listSend( + context: Client, + resourceUri: string, + options: VirtualMachineInstancesListOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/{+resourceUri}/providers/Microsoft.AzureStackHCI/virtualMachineInstances{?api%2Dversion}", + { + resourceUri: resourceUri, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).get({ + ...operationOptionsToRequestParameters(options), + headers: { + accept: "application/json", + ...options.requestOptions?.headers, + }, + }); +} + +export async function _listDeserialize( + result: PathUncheckedResponse, +): Promise<_VirtualMachineInstanceListResult> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return _virtualMachineInstanceListResultDeserializer(result.body); +} + +/** Lists all of the virtual machine instances within the specified parent resource. */ +export function list( + context: Client, + resourceUri: string, + options: VirtualMachineInstancesListOptionalParams = { requestOptions: {} }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _listSend(context, resourceUri, options), + _listDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink" }, + ); +} + +export function _$deleteSend( + context: Client, + resourceUri: string, + options: VirtualMachineInstancesDeleteOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/{+resourceUri}/providers/Microsoft.AzureStackHCI/virtualMachineInstances/default{?api%2Dversion}", + { + resourceUri: resourceUri, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).delete({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _$deleteDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["202", "204", "200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return; +} + +/** The operation to delete a virtual machine instance. */ +/** + * @fixme delete is a reserved word that cannot be used as an operation name. + * Please add @clientName("clientName") or @clientName("", "javascript") + * to the operation to override the generated name. + */ +export function $delete( + context: Client, + resourceUri: string, + options: VirtualMachineInstancesDeleteOptionalParams = { requestOptions: {} }, +): PollerLike, void> { + return getLongRunningPoller(context, _$deleteDeserialize, ["202", "204", "200"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => _$deleteSend(context, resourceUri, options), + resourceLocationConfig: "location", + }) as PollerLike, void>; +} + +export function _updateSend( + context: Client, + resourceUri: string, + properties: VirtualMachineInstanceUpdateRequest, + options: VirtualMachineInstancesUpdateOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/{+resourceUri}/providers/Microsoft.AzureStackHCI/virtualMachineInstances/default{?api%2Dversion}", + { + resourceUri: resourceUri, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).patch({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { + accept: "application/json", + ...options.requestOptions?.headers, + }, + body: virtualMachineInstanceUpdateRequestSerializer(properties), + }); +} + +export async function _updateDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200", "202"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return virtualMachineInstanceDeserializer(result.body); +} + +/** The operation to update a virtual machine instance. */ +export function update( + context: Client, + resourceUri: string, + properties: VirtualMachineInstanceUpdateRequest, + options: VirtualMachineInstancesUpdateOptionalParams = { requestOptions: {} }, +): PollerLike, VirtualMachineInstance> { + return getLongRunningPoller(context, _updateDeserialize, ["200", "202"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => _updateSend(context, resourceUri, properties, options), + resourceLocationConfig: "location", + }) as PollerLike, VirtualMachineInstance>; +} + +export function _createOrUpdateSend( + context: Client, + resourceUri: string, + resource: VirtualMachineInstance, + options: VirtualMachineInstancesCreateOrUpdateOptionalParams = { + requestOptions: {}, + }, +): StreamableMethod { + const path = expandUrlTemplate( + "/{+resourceUri}/providers/Microsoft.AzureStackHCI/virtualMachineInstances/default{?api%2Dversion}", + { + resourceUri: resourceUri, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).put({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { + accept: "application/json", + ...options.requestOptions?.headers, + }, + body: virtualMachineInstanceSerializer(resource), + }); +} + +export async function _createOrUpdateDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200", "201", "202"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return virtualMachineInstanceDeserializer(result.body); +} + +/** The operation to create or update a virtual machine instance. Please note some properties can be set only during virtual machine instance creation. */ +export function createOrUpdate( + context: Client, + resourceUri: string, + resource: VirtualMachineInstance, + options: VirtualMachineInstancesCreateOrUpdateOptionalParams = { + requestOptions: {}, + }, +): PollerLike, VirtualMachineInstance> { + return getLongRunningPoller(context, _createOrUpdateDeserialize, ["200", "201", "202"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => _createOrUpdateSend(context, resourceUri, resource, options), + resourceLocationConfig: "azure-async-operation", + }) as PollerLike, VirtualMachineInstance>; +} + +export function _getSend( + context: Client, + resourceUri: string, + options: VirtualMachineInstancesGetOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/{+resourceUri}/providers/Microsoft.AzureStackHCI/virtualMachineInstances/default{?api%2Dversion}", + { + resourceUri: resourceUri, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).get({ + ...operationOptionsToRequestParameters(options), + headers: { + accept: "application/json", + ...options.requestOptions?.headers, + }, + }); +} + +export async function _getDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return virtualMachineInstanceDeserializer(result.body); +} + +/** Gets a virtual machine instance */ +export async function get( + context: Client, + resourceUri: string, + options: VirtualMachineInstancesGetOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _getSend(context, resourceUri, options); + return _getDeserialize(result); +} diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/src/api/virtualMachineInstances/options.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/src/api/virtualMachineInstances/options.ts new file mode 100644 index 000000000000..16cb81a8d053 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/src/api/virtualMachineInstances/options.ts @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { OperationOptions } from "@azure-rest/core-client"; + +/** Optional parameters. */ +export interface VirtualMachineInstancesSaveOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface VirtualMachineInstancesPauseOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface VirtualMachineInstancesRestartOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface VirtualMachineInstancesStopOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface VirtualMachineInstancesStartOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface VirtualMachineInstancesListOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface VirtualMachineInstancesDeleteOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface VirtualMachineInstancesUpdateOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface VirtualMachineInstancesCreateOrUpdateOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface VirtualMachineInstancesGetOptionalParams extends OperationOptions {} diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/src/azureStackHcivmManagementClient.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/src/azureStackHcivmManagementClient.ts new file mode 100644 index 000000000000..ea73379e2b82 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/src/azureStackHcivmManagementClient.ts @@ -0,0 +1,117 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { + createAzureStackHCIVMManagement, + AzureStackHCIVMManagementContext, + AzureStackHCIVMManagementClientOptionalParams, +} from "./api/index.js"; +import { + AttestationStatusesOperations, + _getAttestationStatusesOperations, +} from "./classic/attestationStatuses/index.js"; +import { + GalleryImagesOperations, + _getGalleryImagesOperations, +} from "./classic/galleryImages/index.js"; +import { GuestAgentsOperations, _getGuestAgentsOperations } from "./classic/guestAgents/index.js"; +import { + HybridIdentityMetadataOperations, + _getHybridIdentityMetadataOperations, +} from "./classic/hybridIdentityMetadata/index.js"; +import { + LogicalNetworksOperations, + _getLogicalNetworksOperations, +} from "./classic/logicalNetworks/index.js"; +import { + MarketplaceGalleryImagesOperations, + _getMarketplaceGalleryImagesOperations, +} from "./classic/marketplaceGalleryImages/index.js"; +import { + NetworkInterfacesOperations, + _getNetworkInterfacesOperations, +} from "./classic/networkInterfaces/index.js"; +import { + NetworkSecurityGroupsOperations, + _getNetworkSecurityGroupsOperations, +} from "./classic/networkSecurityGroups/index.js"; +import { + SecurityRulesOperations, + _getSecurityRulesOperations, +} from "./classic/securityRules/index.js"; +import { + StorageContainersOperations, + _getStorageContainersOperations, +} from "./classic/storageContainers/index.js"; +import { + VirtualHardDisksOperations, + _getVirtualHardDisksOperations, +} from "./classic/virtualHardDisks/index.js"; +import { + VirtualMachineInstancesOperations, + _getVirtualMachineInstancesOperations, +} from "./classic/virtualMachineInstances/index.js"; +import { TokenCredential } from "@azure/core-auth"; +import { Pipeline } from "@azure/core-rest-pipeline"; + +export { AzureStackHCIVMManagementClientOptionalParams } from "./api/azureStackHcivmManagementContext.js"; + +export class AzureStackHCIVMManagementClient { + private _client: AzureStackHCIVMManagementContext; + /** The pipeline used by this client to make requests */ + public readonly pipeline: Pipeline; + + /** Azure Stack HCI management service */ + constructor( + credential: TokenCredential, + subscriptionId: string, + options: AzureStackHCIVMManagementClientOptionalParams = {}, + ) { + const prefixFromOptions = options?.userAgentOptions?.userAgentPrefix; + const userAgentPrefix = prefixFromOptions + ? `${prefixFromOptions} azsdk-js-client` + : `azsdk-js-client`; + this._client = createAzureStackHCIVMManagement(credential, subscriptionId, { + ...options, + userAgentOptions: { userAgentPrefix }, + }); + this.pipeline = this._client.pipeline; + this.guestAgents = _getGuestAgentsOperations(this._client); + this.attestationStatuses = _getAttestationStatusesOperations(this._client); + this.hybridIdentityMetadata = _getHybridIdentityMetadataOperations(this._client); + this.virtualMachineInstances = _getVirtualMachineInstancesOperations(this._client); + this.virtualHardDisks = _getVirtualHardDisksOperations(this._client); + this.storageContainers = _getStorageContainersOperations(this._client); + this.securityRules = _getSecurityRulesOperations(this._client); + this.networkSecurityGroups = _getNetworkSecurityGroupsOperations(this._client); + this.networkInterfaces = _getNetworkInterfacesOperations(this._client); + this.marketplaceGalleryImages = _getMarketplaceGalleryImagesOperations(this._client); + this.logicalNetworks = _getLogicalNetworksOperations(this._client); + this.galleryImages = _getGalleryImagesOperations(this._client); + } + + /** The operation groups for guestAgents */ + public readonly guestAgents: GuestAgentsOperations; + /** The operation groups for attestationStatuses */ + public readonly attestationStatuses: AttestationStatusesOperations; + /** The operation groups for hybridIdentityMetadata */ + public readonly hybridIdentityMetadata: HybridIdentityMetadataOperations; + /** The operation groups for virtualMachineInstances */ + public readonly virtualMachineInstances: VirtualMachineInstancesOperations; + /** The operation groups for virtualHardDisks */ + public readonly virtualHardDisks: VirtualHardDisksOperations; + /** The operation groups for storageContainers */ + public readonly storageContainers: StorageContainersOperations; + /** The operation groups for securityRules */ + public readonly securityRules: SecurityRulesOperations; + /** The operation groups for networkSecurityGroups */ + public readonly networkSecurityGroups: NetworkSecurityGroupsOperations; + /** The operation groups for networkInterfaces */ + public readonly networkInterfaces: NetworkInterfacesOperations; + /** The operation groups for marketplaceGalleryImages */ + public readonly marketplaceGalleryImages: MarketplaceGalleryImagesOperations; + /** The operation groups for logicalNetworks */ + public readonly logicalNetworks: LogicalNetworksOperations; + /** The operation groups for galleryImages */ + public readonly galleryImages: GalleryImagesOperations; +} diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/src/classic/attestationStatuses/index.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/src/classic/attestationStatuses/index.ts new file mode 100644 index 000000000000..4dce528b72c8 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/src/classic/attestationStatuses/index.ts @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { AzureStackHCIVMManagementContext } from "../../api/azureStackHcivmManagementContext.js"; +import { get } from "../../api/attestationStatuses/operations.js"; +import { AttestationStatusesGetOptionalParams } from "../../api/attestationStatuses/options.js"; +import { AttestationStatus } from "../../models/models.js"; + +/** Interface representing a AttestationStatuses operations. */ +export interface AttestationStatusesOperations { + /** Implements AttestationStatus GET method. */ + get: ( + resourceUri: string, + options?: AttestationStatusesGetOptionalParams, + ) => Promise; +} + +function _getAttestationStatuses(context: AzureStackHCIVMManagementContext) { + return { + get: (resourceUri: string, options?: AttestationStatusesGetOptionalParams) => + get(context, resourceUri, options), + }; +} + +export function _getAttestationStatusesOperations( + context: AzureStackHCIVMManagementContext, +): AttestationStatusesOperations { + return { + ..._getAttestationStatuses(context), + }; +} diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/src/classic/galleryImages/index.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/src/classic/galleryImages/index.ts new file mode 100644 index 000000000000..80a058e5cbc2 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/src/classic/galleryImages/index.ts @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { AzureStackHCIVMManagementContext } from "../../api/azureStackHcivmManagementContext.js"; +import { + listAll, + listByResourceGroup, + $delete, + update, + createOrUpdate, + get, +} from "../../api/galleryImages/operations.js"; +import { + GalleryImagesListAllOptionalParams, + GalleryImagesListByResourceGroupOptionalParams, + GalleryImagesDeleteOptionalParams, + GalleryImagesUpdateOptionalParams, + GalleryImagesCreateOrUpdateOptionalParams, + GalleryImagesGetOptionalParams, +} from "../../api/galleryImages/options.js"; +import { GalleryImage, GalleryImageTagsUpdate } from "../../models/models.js"; +import { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; +import { PollerLike, OperationState } from "@azure/core-lro"; + +/** Interface representing a GalleryImages operations. */ +export interface GalleryImagesOperations { + /** Lists all of the gallery images in the specified subscription. Use the nextLink property in the response to get the next page of gallery images. */ + listAll: ( + options?: GalleryImagesListAllOptionalParams, + ) => PagedAsyncIterableIterator; + /** Lists all of the gallery images in the specified resource group. Use the nextLink property in the response to get the next page of gallery images. */ + listByResourceGroup: ( + resourceGroupName: string, + options?: GalleryImagesListByResourceGroupOptionalParams, + ) => PagedAsyncIterableIterator; + /** The operation to delete a gallery image. */ + /** + * @fixme delete is a reserved word that cannot be used as an operation name. + * Please add @clientName("clientName") or @clientName("", "javascript") + * to the operation to override the generated name. + */ + delete: ( + resourceGroupName: string, + galleryImageName: string, + options?: GalleryImagesDeleteOptionalParams, + ) => PollerLike, void>; + /** The operation to update a gallery image. */ + update: ( + resourceGroupName: string, + galleryImageName: string, + properties: GalleryImageTagsUpdate, + options?: GalleryImagesUpdateOptionalParams, + ) => PollerLike, GalleryImage>; + /** The operation to create or update a gallery image. Please note some properties can be set only during gallery image creation. */ + createOrUpdate: ( + resourceGroupName: string, + galleryImageName: string, + resource: GalleryImage, + options?: GalleryImagesCreateOrUpdateOptionalParams, + ) => PollerLike, GalleryImage>; + /** Gets a gallery image */ + get: ( + resourceGroupName: string, + galleryImageName: string, + options?: GalleryImagesGetOptionalParams, + ) => Promise; +} + +function _getGalleryImages(context: AzureStackHCIVMManagementContext) { + return { + listAll: (options?: GalleryImagesListAllOptionalParams) => listAll(context, options), + listByResourceGroup: ( + resourceGroupName: string, + options?: GalleryImagesListByResourceGroupOptionalParams, + ) => listByResourceGroup(context, resourceGroupName, options), + delete: ( + resourceGroupName: string, + galleryImageName: string, + options?: GalleryImagesDeleteOptionalParams, + ) => $delete(context, resourceGroupName, galleryImageName, options), + update: ( + resourceGroupName: string, + galleryImageName: string, + properties: GalleryImageTagsUpdate, + options?: GalleryImagesUpdateOptionalParams, + ) => update(context, resourceGroupName, galleryImageName, properties, options), + createOrUpdate: ( + resourceGroupName: string, + galleryImageName: string, + resource: GalleryImage, + options?: GalleryImagesCreateOrUpdateOptionalParams, + ) => createOrUpdate(context, resourceGroupName, galleryImageName, resource, options), + get: ( + resourceGroupName: string, + galleryImageName: string, + options?: GalleryImagesGetOptionalParams, + ) => get(context, resourceGroupName, galleryImageName, options), + }; +} + +export function _getGalleryImagesOperations( + context: AzureStackHCIVMManagementContext, +): GalleryImagesOperations { + return { + ..._getGalleryImages(context), + }; +} diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/src/classic/guestAgents/index.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/src/classic/guestAgents/index.ts new file mode 100644 index 000000000000..9ba00f3af1fc --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/src/classic/guestAgents/index.ts @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { AzureStackHCIVMManagementContext } from "../../api/azureStackHcivmManagementContext.js"; +import { + listByVirtualMachineInstance, + $delete, + create, + get, +} from "../../api/guestAgents/operations.js"; +import { + GuestAgentsListByVirtualMachineInstanceOptionalParams, + GuestAgentsDeleteOptionalParams, + GuestAgentsCreateOptionalParams, + GuestAgentsGetOptionalParams, +} from "../../api/guestAgents/options.js"; +import { GuestAgent } from "../../models/models.js"; +import { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; +import { PollerLike, OperationState } from "@azure/core-lro"; + +/** Interface representing a GuestAgents operations. */ +export interface GuestAgentsOperations { + /** Returns the list of GuestAgent of the given vm. */ + listByVirtualMachineInstance: ( + resourceUri: string, + options?: GuestAgentsListByVirtualMachineInstanceOptionalParams, + ) => PagedAsyncIterableIterator; + /** Implements GuestAgent DELETE method. */ + /** + * @fixme delete is a reserved word that cannot be used as an operation name. + * Please add @clientName("clientName") or @clientName("", "javascript") + * to the operation to override the generated name. + */ + delete: ( + resourceUri: string, + options?: GuestAgentsDeleteOptionalParams, + ) => PollerLike, void>; + /** Create Or Update GuestAgent. */ + create: ( + resourceUri: string, + resource: GuestAgent, + options?: GuestAgentsCreateOptionalParams, + ) => PollerLike, GuestAgent>; + /** Implements GuestAgent GET method. */ + get: (resourceUri: string, options?: GuestAgentsGetOptionalParams) => Promise; +} + +function _getGuestAgents(context: AzureStackHCIVMManagementContext) { + return { + listByVirtualMachineInstance: ( + resourceUri: string, + options?: GuestAgentsListByVirtualMachineInstanceOptionalParams, + ) => listByVirtualMachineInstance(context, resourceUri, options), + delete: (resourceUri: string, options?: GuestAgentsDeleteOptionalParams) => + $delete(context, resourceUri, options), + create: ( + resourceUri: string, + resource: GuestAgent, + options?: GuestAgentsCreateOptionalParams, + ) => create(context, resourceUri, resource, options), + get: (resourceUri: string, options?: GuestAgentsGetOptionalParams) => + get(context, resourceUri, options), + }; +} + +export function _getGuestAgentsOperations( + context: AzureStackHCIVMManagementContext, +): GuestAgentsOperations { + return { + ..._getGuestAgents(context), + }; +} diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/src/classic/hybridIdentityMetadata/index.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/src/classic/hybridIdentityMetadata/index.ts new file mode 100644 index 000000000000..5869104251ed --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/src/classic/hybridIdentityMetadata/index.ts @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { AzureStackHCIVMManagementContext } from "../../api/azureStackHcivmManagementContext.js"; +import { listByVirtualMachineInstance, get } from "../../api/hybridIdentityMetadata/operations.js"; +import { + HybridIdentityMetadataListByVirtualMachineInstanceOptionalParams, + HybridIdentityMetadataGetOptionalParams, +} from "../../api/hybridIdentityMetadata/options.js"; +import { HybridIdentityMetadata } from "../../models/models.js"; +import { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; + +/** Interface representing a HybridIdentityMetadata operations. */ +export interface HybridIdentityMetadataOperations { + /** Returns the list of HybridIdentityMetadata of the given vm. */ + listByVirtualMachineInstance: ( + resourceUri: string, + options?: HybridIdentityMetadataListByVirtualMachineInstanceOptionalParams, + ) => PagedAsyncIterableIterator; + /** Implements HybridIdentityMetadata GET method. */ + get: ( + resourceUri: string, + options?: HybridIdentityMetadataGetOptionalParams, + ) => Promise; +} + +function _getHybridIdentityMetadata(context: AzureStackHCIVMManagementContext) { + return { + listByVirtualMachineInstance: ( + resourceUri: string, + options?: HybridIdentityMetadataListByVirtualMachineInstanceOptionalParams, + ) => listByVirtualMachineInstance(context, resourceUri, options), + get: (resourceUri: string, options?: HybridIdentityMetadataGetOptionalParams) => + get(context, resourceUri, options), + }; +} + +export function _getHybridIdentityMetadataOperations( + context: AzureStackHCIVMManagementContext, +): HybridIdentityMetadataOperations { + return { + ..._getHybridIdentityMetadata(context), + }; +} diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/src/classic/index.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/src/classic/index.ts new file mode 100644 index 000000000000..2aea8451aa54 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/src/classic/index.ts @@ -0,0 +1,15 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { AttestationStatusesOperations } from "./attestationStatuses/index.js"; +export { GalleryImagesOperations } from "./galleryImages/index.js"; +export { GuestAgentsOperations } from "./guestAgents/index.js"; +export { HybridIdentityMetadataOperations } from "./hybridIdentityMetadata/index.js"; +export { LogicalNetworksOperations } from "./logicalNetworks/index.js"; +export { MarketplaceGalleryImagesOperations } from "./marketplaceGalleryImages/index.js"; +export { NetworkInterfacesOperations } from "./networkInterfaces/index.js"; +export { NetworkSecurityGroupsOperations } from "./networkSecurityGroups/index.js"; +export { SecurityRulesOperations } from "./securityRules/index.js"; +export { StorageContainersOperations } from "./storageContainers/index.js"; +export { VirtualHardDisksOperations } from "./virtualHardDisks/index.js"; +export { VirtualMachineInstancesOperations } from "./virtualMachineInstances/index.js"; diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/src/classic/logicalNetworks/index.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/src/classic/logicalNetworks/index.ts new file mode 100644 index 000000000000..09bba1e263c5 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/src/classic/logicalNetworks/index.ts @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { AzureStackHCIVMManagementContext } from "../../api/azureStackHcivmManagementContext.js"; +import { + listAll, + listByResourceGroup, + $delete, + update, + createOrUpdate, + get, +} from "../../api/logicalNetworks/operations.js"; +import { + LogicalNetworksListAllOptionalParams, + LogicalNetworksListByResourceGroupOptionalParams, + LogicalNetworksDeleteOptionalParams, + LogicalNetworksUpdateOptionalParams, + LogicalNetworksCreateOrUpdateOptionalParams, + LogicalNetworksGetOptionalParams, +} from "../../api/logicalNetworks/options.js"; +import { LogicalNetwork, LogicalNetworksUpdateRequest } from "../../models/models.js"; +import { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; +import { PollerLike, OperationState } from "@azure/core-lro"; + +/** Interface representing a LogicalNetworks operations. */ +export interface LogicalNetworksOperations { + /** Lists all of the logical networks in the specified subscription. Use the nextLink property in the response to get the next page of logical networks. */ + listAll: ( + options?: LogicalNetworksListAllOptionalParams, + ) => PagedAsyncIterableIterator; + /** Lists all of the logical networks in the specified resource group. Use the nextLink property in the response to get the next page of logical networks. */ + listByResourceGroup: ( + resourceGroupName: string, + options?: LogicalNetworksListByResourceGroupOptionalParams, + ) => PagedAsyncIterableIterator; + /** The operation to delete a logical network. */ + /** + * @fixme delete is a reserved word that cannot be used as an operation name. + * Please add @clientName("clientName") or @clientName("", "javascript") + * to the operation to override the generated name. + */ + delete: ( + resourceGroupName: string, + logicalNetworkName: string, + options?: LogicalNetworksDeleteOptionalParams, + ) => PollerLike, void>; + /** The operation to update a logical network. */ + update: ( + resourceGroupName: string, + logicalNetworkName: string, + properties: LogicalNetworksUpdateRequest, + options?: LogicalNetworksUpdateOptionalParams, + ) => PollerLike, LogicalNetwork>; + /** The operation to create or update a logical network. Please note some properties can be set only during logical network creation. */ + createOrUpdate: ( + resourceGroupName: string, + logicalNetworkName: string, + resource: LogicalNetwork, + options?: LogicalNetworksCreateOrUpdateOptionalParams, + ) => PollerLike, LogicalNetwork>; + /** The operation to get a logical network. */ + get: ( + resourceGroupName: string, + logicalNetworkName: string, + options?: LogicalNetworksGetOptionalParams, + ) => Promise; +} + +function _getLogicalNetworks(context: AzureStackHCIVMManagementContext) { + return { + listAll: (options?: LogicalNetworksListAllOptionalParams) => listAll(context, options), + listByResourceGroup: ( + resourceGroupName: string, + options?: LogicalNetworksListByResourceGroupOptionalParams, + ) => listByResourceGroup(context, resourceGroupName, options), + delete: ( + resourceGroupName: string, + logicalNetworkName: string, + options?: LogicalNetworksDeleteOptionalParams, + ) => $delete(context, resourceGroupName, logicalNetworkName, options), + update: ( + resourceGroupName: string, + logicalNetworkName: string, + properties: LogicalNetworksUpdateRequest, + options?: LogicalNetworksUpdateOptionalParams, + ) => update(context, resourceGroupName, logicalNetworkName, properties, options), + createOrUpdate: ( + resourceGroupName: string, + logicalNetworkName: string, + resource: LogicalNetwork, + options?: LogicalNetworksCreateOrUpdateOptionalParams, + ) => createOrUpdate(context, resourceGroupName, logicalNetworkName, resource, options), + get: ( + resourceGroupName: string, + logicalNetworkName: string, + options?: LogicalNetworksGetOptionalParams, + ) => get(context, resourceGroupName, logicalNetworkName, options), + }; +} + +export function _getLogicalNetworksOperations( + context: AzureStackHCIVMManagementContext, +): LogicalNetworksOperations { + return { + ..._getLogicalNetworks(context), + }; +} diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/src/classic/marketplaceGalleryImages/index.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/src/classic/marketplaceGalleryImages/index.ts new file mode 100644 index 000000000000..b25558027212 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/src/classic/marketplaceGalleryImages/index.ts @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { AzureStackHCIVMManagementContext } from "../../api/azureStackHcivmManagementContext.js"; +import { + listAll, + listByResourceGroup, + $delete, + update, + createOrUpdate, + get, +} from "../../api/marketplaceGalleryImages/operations.js"; +import { + MarketplaceGalleryImagesListAllOptionalParams, + MarketplaceGalleryImagesListByResourceGroupOptionalParams, + MarketplaceGalleryImagesDeleteOptionalParams, + MarketplaceGalleryImagesUpdateOptionalParams, + MarketplaceGalleryImagesCreateOrUpdateOptionalParams, + MarketplaceGalleryImagesGetOptionalParams, +} from "../../api/marketplaceGalleryImages/options.js"; +import { MarketplaceGalleryImage, MarketplaceGalleryImageTagsUpdate } from "../../models/models.js"; +import { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; +import { PollerLike, OperationState } from "@azure/core-lro"; + +/** Interface representing a MarketplaceGalleryImages operations. */ +export interface MarketplaceGalleryImagesOperations { + /** Lists all of the marketplace gallery images in the specified subscription. Use the nextLink property in the response to get the next page of marketplace gallery images. */ + listAll: ( + options?: MarketplaceGalleryImagesListAllOptionalParams, + ) => PagedAsyncIterableIterator; + /** Lists all of the marketplace gallery images in the specified resource group. Use the nextLink property in the response to get the next page of marketplace gallery images. */ + listByResourceGroup: ( + resourceGroupName: string, + options?: MarketplaceGalleryImagesListByResourceGroupOptionalParams, + ) => PagedAsyncIterableIterator; + /** The operation to delete a marketplace gallery image. */ + /** + * @fixme delete is a reserved word that cannot be used as an operation name. + * Please add @clientName("clientName") or @clientName("", "javascript") + * to the operation to override the generated name. + */ + delete: ( + resourceGroupName: string, + marketplaceGalleryImageName: string, + options?: MarketplaceGalleryImagesDeleteOptionalParams, + ) => PollerLike, void>; + /** The operation to update a marketplace gallery image. */ + update: ( + resourceGroupName: string, + marketplaceGalleryImageName: string, + properties: MarketplaceGalleryImageTagsUpdate, + options?: MarketplaceGalleryImagesUpdateOptionalParams, + ) => PollerLike, MarketplaceGalleryImage>; + /** The operation to create or update a marketplace gallery image. Please note some properties can be set only during marketplace gallery image creation. */ + createOrUpdate: ( + resourceGroupName: string, + marketplaceGalleryImageName: string, + resource: MarketplaceGalleryImage, + options?: MarketplaceGalleryImagesCreateOrUpdateOptionalParams, + ) => PollerLike, MarketplaceGalleryImage>; + /** Gets a marketplace gallery image */ + get: ( + resourceGroupName: string, + marketplaceGalleryImageName: string, + options?: MarketplaceGalleryImagesGetOptionalParams, + ) => Promise; +} + +function _getMarketplaceGalleryImages(context: AzureStackHCIVMManagementContext) { + return { + listAll: (options?: MarketplaceGalleryImagesListAllOptionalParams) => listAll(context, options), + listByResourceGroup: ( + resourceGroupName: string, + options?: MarketplaceGalleryImagesListByResourceGroupOptionalParams, + ) => listByResourceGroup(context, resourceGroupName, options), + delete: ( + resourceGroupName: string, + marketplaceGalleryImageName: string, + options?: MarketplaceGalleryImagesDeleteOptionalParams, + ) => $delete(context, resourceGroupName, marketplaceGalleryImageName, options), + update: ( + resourceGroupName: string, + marketplaceGalleryImageName: string, + properties: MarketplaceGalleryImageTagsUpdate, + options?: MarketplaceGalleryImagesUpdateOptionalParams, + ) => update(context, resourceGroupName, marketplaceGalleryImageName, properties, options), + createOrUpdate: ( + resourceGroupName: string, + marketplaceGalleryImageName: string, + resource: MarketplaceGalleryImage, + options?: MarketplaceGalleryImagesCreateOrUpdateOptionalParams, + ) => createOrUpdate(context, resourceGroupName, marketplaceGalleryImageName, resource, options), + get: ( + resourceGroupName: string, + marketplaceGalleryImageName: string, + options?: MarketplaceGalleryImagesGetOptionalParams, + ) => get(context, resourceGroupName, marketplaceGalleryImageName, options), + }; +} + +export function _getMarketplaceGalleryImagesOperations( + context: AzureStackHCIVMManagementContext, +): MarketplaceGalleryImagesOperations { + return { + ..._getMarketplaceGalleryImages(context), + }; +} diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/src/classic/networkInterfaces/index.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/src/classic/networkInterfaces/index.ts new file mode 100644 index 000000000000..bf1c77a9ae48 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/src/classic/networkInterfaces/index.ts @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { AzureStackHCIVMManagementContext } from "../../api/azureStackHcivmManagementContext.js"; +import { + listAll, + listByResourceGroup, + $delete, + update, + createOrUpdate, + get, +} from "../../api/networkInterfaces/operations.js"; +import { + NetworkInterfacesListAllOptionalParams, + NetworkInterfacesListByResourceGroupOptionalParams, + NetworkInterfacesDeleteOptionalParams, + NetworkInterfacesUpdateOptionalParams, + NetworkInterfacesCreateOrUpdateOptionalParams, + NetworkInterfacesGetOptionalParams, +} from "../../api/networkInterfaces/options.js"; +import { NetworkInterface, NetworkInterfacesUpdateRequest } from "../../models/models.js"; +import { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; +import { PollerLike, OperationState } from "@azure/core-lro"; + +/** Interface representing a NetworkInterfaces operations. */ +export interface NetworkInterfacesOperations { + /** Lists all of the network interfaces in the specified subscription. Use the nextLink property in the response to get the next page of network interfaces. */ + listAll: ( + options?: NetworkInterfacesListAllOptionalParams, + ) => PagedAsyncIterableIterator; + /** Lists all of the network interfaces in the specified resource group. Use the nextLink property in the response to get the next page of network interfaces. */ + listByResourceGroup: ( + resourceGroupName: string, + options?: NetworkInterfacesListByResourceGroupOptionalParams, + ) => PagedAsyncIterableIterator; + /** The operation to delete a network interface. */ + /** + * @fixme delete is a reserved word that cannot be used as an operation name. + * Please add @clientName("clientName") or @clientName("", "javascript") + * to the operation to override the generated name. + */ + delete: ( + resourceGroupName: string, + networkInterfaceName: string, + options?: NetworkInterfacesDeleteOptionalParams, + ) => PollerLike, void>; + /** The operation to update a network interface. */ + update: ( + resourceGroupName: string, + networkInterfaceName: string, + properties: NetworkInterfacesUpdateRequest, + options?: NetworkInterfacesUpdateOptionalParams, + ) => PollerLike, NetworkInterface>; + /** The operation to create or update a network interface. Please note some properties can be set only during network interface creation. */ + createOrUpdate: ( + resourceGroupName: string, + networkInterfaceName: string, + resource: NetworkInterface, + options?: NetworkInterfacesCreateOrUpdateOptionalParams, + ) => PollerLike, NetworkInterface>; + /** Gets a network interface */ + get: ( + resourceGroupName: string, + networkInterfaceName: string, + options?: NetworkInterfacesGetOptionalParams, + ) => Promise; +} + +function _getNetworkInterfaces(context: AzureStackHCIVMManagementContext) { + return { + listAll: (options?: NetworkInterfacesListAllOptionalParams) => listAll(context, options), + listByResourceGroup: ( + resourceGroupName: string, + options?: NetworkInterfacesListByResourceGroupOptionalParams, + ) => listByResourceGroup(context, resourceGroupName, options), + delete: ( + resourceGroupName: string, + networkInterfaceName: string, + options?: NetworkInterfacesDeleteOptionalParams, + ) => $delete(context, resourceGroupName, networkInterfaceName, options), + update: ( + resourceGroupName: string, + networkInterfaceName: string, + properties: NetworkInterfacesUpdateRequest, + options?: NetworkInterfacesUpdateOptionalParams, + ) => update(context, resourceGroupName, networkInterfaceName, properties, options), + createOrUpdate: ( + resourceGroupName: string, + networkInterfaceName: string, + resource: NetworkInterface, + options?: NetworkInterfacesCreateOrUpdateOptionalParams, + ) => createOrUpdate(context, resourceGroupName, networkInterfaceName, resource, options), + get: ( + resourceGroupName: string, + networkInterfaceName: string, + options?: NetworkInterfacesGetOptionalParams, + ) => get(context, resourceGroupName, networkInterfaceName, options), + }; +} + +export function _getNetworkInterfacesOperations( + context: AzureStackHCIVMManagementContext, +): NetworkInterfacesOperations { + return { + ..._getNetworkInterfaces(context), + }; +} diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/src/classic/networkSecurityGroups/index.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/src/classic/networkSecurityGroups/index.ts new file mode 100644 index 000000000000..5bf02d7457d8 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/src/classic/networkSecurityGroups/index.ts @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { AzureStackHCIVMManagementContext } from "../../api/azureStackHcivmManagementContext.js"; +import { + listAll, + listByResourceGroup, + $delete, + updateTags, + createOrUpdate, + get, +} from "../../api/networkSecurityGroups/operations.js"; +import { + NetworkSecurityGroupsListAllOptionalParams, + NetworkSecurityGroupsListByResourceGroupOptionalParams, + NetworkSecurityGroupsDeleteOptionalParams, + NetworkSecurityGroupsUpdateTagsOptionalParams, + NetworkSecurityGroupsCreateOrUpdateOptionalParams, + NetworkSecurityGroupsGetOptionalParams, +} from "../../api/networkSecurityGroups/options.js"; +import { NetworkSecurityGroup, NetworkSecurityGroupTagsUpdate } from "../../models/models.js"; +import { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; +import { PollerLike, OperationState } from "@azure/core-lro"; + +/** Interface representing a NetworkSecurityGroups operations. */ +export interface NetworkSecurityGroupsOperations { + /** Gets all network security groups in a subscription. */ + listAll: ( + options?: NetworkSecurityGroupsListAllOptionalParams, + ) => PagedAsyncIterableIterator; + /** Gets all network security groups in a resource group. */ + listByResourceGroup: ( + resourceGroupName: string, + options?: NetworkSecurityGroupsListByResourceGroupOptionalParams, + ) => PagedAsyncIterableIterator; + /** Deletes the specified network security group. */ + /** + * @fixme delete is a reserved word that cannot be used as an operation name. + * Please add @clientName("clientName") or @clientName("", "javascript") + * to the operation to override the generated name. + */ + delete: ( + resourceGroupName: string, + networkSecurityGroupName: string, + options?: NetworkSecurityGroupsDeleteOptionalParams, + ) => PollerLike, void>; + /** Updates a network security group tags. */ + updateTags: ( + resourceGroupName: string, + networkSecurityGroupName: string, + properties: NetworkSecurityGroupTagsUpdate, + options?: NetworkSecurityGroupsUpdateTagsOptionalParams, + ) => PollerLike, NetworkSecurityGroup>; + /** Creates or updates a network security group in the specified resource group. */ + createOrUpdate: ( + resourceGroupName: string, + networkSecurityGroupName: string, + resource: NetworkSecurityGroup, + options?: NetworkSecurityGroupsCreateOrUpdateOptionalParams, + ) => PollerLike, NetworkSecurityGroup>; + /** Gets the specified network security group. */ + get: ( + resourceGroupName: string, + networkSecurityGroupName: string, + options?: NetworkSecurityGroupsGetOptionalParams, + ) => Promise; +} + +function _getNetworkSecurityGroups(context: AzureStackHCIVMManagementContext) { + return { + listAll: (options?: NetworkSecurityGroupsListAllOptionalParams) => listAll(context, options), + listByResourceGroup: ( + resourceGroupName: string, + options?: NetworkSecurityGroupsListByResourceGroupOptionalParams, + ) => listByResourceGroup(context, resourceGroupName, options), + delete: ( + resourceGroupName: string, + networkSecurityGroupName: string, + options?: NetworkSecurityGroupsDeleteOptionalParams, + ) => $delete(context, resourceGroupName, networkSecurityGroupName, options), + updateTags: ( + resourceGroupName: string, + networkSecurityGroupName: string, + properties: NetworkSecurityGroupTagsUpdate, + options?: NetworkSecurityGroupsUpdateTagsOptionalParams, + ) => updateTags(context, resourceGroupName, networkSecurityGroupName, properties, options), + createOrUpdate: ( + resourceGroupName: string, + networkSecurityGroupName: string, + resource: NetworkSecurityGroup, + options?: NetworkSecurityGroupsCreateOrUpdateOptionalParams, + ) => createOrUpdate(context, resourceGroupName, networkSecurityGroupName, resource, options), + get: ( + resourceGroupName: string, + networkSecurityGroupName: string, + options?: NetworkSecurityGroupsGetOptionalParams, + ) => get(context, resourceGroupName, networkSecurityGroupName, options), + }; +} + +export function _getNetworkSecurityGroupsOperations( + context: AzureStackHCIVMManagementContext, +): NetworkSecurityGroupsOperations { + return { + ..._getNetworkSecurityGroups(context), + }; +} diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/src/classic/securityRules/index.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/src/classic/securityRules/index.ts new file mode 100644 index 000000000000..e321c09bdd86 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/src/classic/securityRules/index.ts @@ -0,0 +1,101 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { AzureStackHCIVMManagementContext } from "../../api/azureStackHcivmManagementContext.js"; +import { + listByNetworkSecurityGroup, + $delete, + createOrUpdate, + get, +} from "../../api/securityRules/operations.js"; +import { + SecurityRulesListByNetworkSecurityGroupOptionalParams, + SecurityRulesDeleteOptionalParams, + SecurityRulesCreateOrUpdateOptionalParams, + SecurityRulesGetOptionalParams, +} from "../../api/securityRules/options.js"; +import { SecurityRule } from "../../models/models.js"; +import { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; +import { PollerLike, OperationState } from "@azure/core-lro"; + +/** Interface representing a SecurityRules operations. */ +export interface SecurityRulesOperations { + /** Gets all security rules in a Network Security Group. */ + listByNetworkSecurityGroup: ( + resourceGroupName: string, + networkSecurityGroupName: string, + options?: SecurityRulesListByNetworkSecurityGroupOptionalParams, + ) => PagedAsyncIterableIterator; + /** Deletes the specified security rule. */ + /** + * @fixme delete is a reserved word that cannot be used as an operation name. + * Please add @clientName("clientName") or @clientName("", "javascript") + * to the operation to override the generated name. + */ + delete: ( + resourceGroupName: string, + networkSecurityGroupName: string, + securityRuleName: string, + options?: SecurityRulesDeleteOptionalParams, + ) => PollerLike, void>; + /** Creates or updates a security rule in the specified resource group. */ + createOrUpdate: ( + resourceGroupName: string, + networkSecurityGroupName: string, + securityRuleName: string, + resource: SecurityRule, + options?: SecurityRulesCreateOrUpdateOptionalParams, + ) => PollerLike, SecurityRule>; + /** Gets the specified security rule. */ + get: ( + resourceGroupName: string, + networkSecurityGroupName: string, + securityRuleName: string, + options?: SecurityRulesGetOptionalParams, + ) => Promise; +} + +function _getSecurityRules(context: AzureStackHCIVMManagementContext) { + return { + listByNetworkSecurityGroup: ( + resourceGroupName: string, + networkSecurityGroupName: string, + options?: SecurityRulesListByNetworkSecurityGroupOptionalParams, + ) => listByNetworkSecurityGroup(context, resourceGroupName, networkSecurityGroupName, options), + delete: ( + resourceGroupName: string, + networkSecurityGroupName: string, + securityRuleName: string, + options?: SecurityRulesDeleteOptionalParams, + ) => $delete(context, resourceGroupName, networkSecurityGroupName, securityRuleName, options), + createOrUpdate: ( + resourceGroupName: string, + networkSecurityGroupName: string, + securityRuleName: string, + resource: SecurityRule, + options?: SecurityRulesCreateOrUpdateOptionalParams, + ) => + createOrUpdate( + context, + resourceGroupName, + networkSecurityGroupName, + securityRuleName, + resource, + options, + ), + get: ( + resourceGroupName: string, + networkSecurityGroupName: string, + securityRuleName: string, + options?: SecurityRulesGetOptionalParams, + ) => get(context, resourceGroupName, networkSecurityGroupName, securityRuleName, options), + }; +} + +export function _getSecurityRulesOperations( + context: AzureStackHCIVMManagementContext, +): SecurityRulesOperations { + return { + ..._getSecurityRules(context), + }; +} diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/src/classic/storageContainers/index.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/src/classic/storageContainers/index.ts new file mode 100644 index 000000000000..3a6298a0d519 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/src/classic/storageContainers/index.ts @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { AzureStackHCIVMManagementContext } from "../../api/azureStackHcivmManagementContext.js"; +import { + listAll, + listByResourceGroup, + $delete, + update, + createOrUpdate, + get, +} from "../../api/storageContainers/operations.js"; +import { + StorageContainersListAllOptionalParams, + StorageContainersListByResourceGroupOptionalParams, + StorageContainersDeleteOptionalParams, + StorageContainersUpdateOptionalParams, + StorageContainersCreateOrUpdateOptionalParams, + StorageContainersGetOptionalParams, +} from "../../api/storageContainers/options.js"; +import { StorageContainer, StorageContainerTagsUpdate } from "../../models/models.js"; +import { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; +import { PollerLike, OperationState } from "@azure/core-lro"; + +/** Interface representing a StorageContainers operations. */ +export interface StorageContainersOperations { + /** Lists all of the storage containers in the specified subscription. Use the nextLink property in the response to get the next page of storage containers. */ + listAll: ( + options?: StorageContainersListAllOptionalParams, + ) => PagedAsyncIterableIterator; + /** Lists all of the storage containers in the specified resource group. Use the nextLink property in the response to get the next page of storage containers. */ + listByResourceGroup: ( + resourceGroupName: string, + options?: StorageContainersListByResourceGroupOptionalParams, + ) => PagedAsyncIterableIterator; + /** The operation to delete a storage container. */ + /** + * @fixme delete is a reserved word that cannot be used as an operation name. + * Please add @clientName("clientName") or @clientName("", "javascript") + * to the operation to override the generated name. + */ + delete: ( + resourceGroupName: string, + storageContainerName: string, + options?: StorageContainersDeleteOptionalParams, + ) => PollerLike, void>; + /** The operation to update a storage container. */ + update: ( + resourceGroupName: string, + storageContainerName: string, + properties: StorageContainerTagsUpdate, + options?: StorageContainersUpdateOptionalParams, + ) => PollerLike, StorageContainer>; + /** The operation to create or update a storage container. Please note some properties can be set only during storage container creation. */ + createOrUpdate: ( + resourceGroupName: string, + storageContainerName: string, + resource: StorageContainer, + options?: StorageContainersCreateOrUpdateOptionalParams, + ) => PollerLike, StorageContainer>; + /** Gets a storage container */ + get: ( + resourceGroupName: string, + storageContainerName: string, + options?: StorageContainersGetOptionalParams, + ) => Promise; +} + +function _getStorageContainers(context: AzureStackHCIVMManagementContext) { + return { + listAll: (options?: StorageContainersListAllOptionalParams) => listAll(context, options), + listByResourceGroup: ( + resourceGroupName: string, + options?: StorageContainersListByResourceGroupOptionalParams, + ) => listByResourceGroup(context, resourceGroupName, options), + delete: ( + resourceGroupName: string, + storageContainerName: string, + options?: StorageContainersDeleteOptionalParams, + ) => $delete(context, resourceGroupName, storageContainerName, options), + update: ( + resourceGroupName: string, + storageContainerName: string, + properties: StorageContainerTagsUpdate, + options?: StorageContainersUpdateOptionalParams, + ) => update(context, resourceGroupName, storageContainerName, properties, options), + createOrUpdate: ( + resourceGroupName: string, + storageContainerName: string, + resource: StorageContainer, + options?: StorageContainersCreateOrUpdateOptionalParams, + ) => createOrUpdate(context, resourceGroupName, storageContainerName, resource, options), + get: ( + resourceGroupName: string, + storageContainerName: string, + options?: StorageContainersGetOptionalParams, + ) => get(context, resourceGroupName, storageContainerName, options), + }; +} + +export function _getStorageContainersOperations( + context: AzureStackHCIVMManagementContext, +): StorageContainersOperations { + return { + ..._getStorageContainers(context), + }; +} diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/src/classic/virtualHardDisks/index.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/src/classic/virtualHardDisks/index.ts new file mode 100644 index 000000000000..e3c80d0d71a4 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/src/classic/virtualHardDisks/index.ts @@ -0,0 +1,127 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { AzureStackHCIVMManagementContext } from "../../api/azureStackHcivmManagementContext.js"; +import { + upload, + listAll, + listByResourceGroup, + $delete, + update, + createOrUpdate, + get, +} from "../../api/virtualHardDisks/operations.js"; +import { + VirtualHardDisksUploadOptionalParams, + VirtualHardDisksListAllOptionalParams, + VirtualHardDisksListByResourceGroupOptionalParams, + VirtualHardDisksDeleteOptionalParams, + VirtualHardDisksUpdateOptionalParams, + VirtualHardDisksCreateOrUpdateOptionalParams, + VirtualHardDisksGetOptionalParams, +} from "../../api/virtualHardDisks/options.js"; +import { + VirtualHardDisk, + VirtualHardDisksUpdateRequest, + VirtualHardDiskUploadRequest, + VirtualHardDiskUploadResponse, +} from "../../models/models.js"; +import { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; +import { PollerLike, OperationState } from "@azure/core-lro"; + +/** Interface representing a VirtualHardDisks operations. */ +export interface VirtualHardDisksOperations { + /** The operation to upload a virtual hard disk. */ + upload: ( + resourceGroupName: string, + virtualHardDiskName: string, + body: VirtualHardDiskUploadRequest, + options?: VirtualHardDisksUploadOptionalParams, + ) => PollerLike, VirtualHardDiskUploadResponse>; + /** Lists all of the virtual hard disks in the specified subscription. Use the nextLink property in the response to get the next page of virtual hard disks. */ + listAll: ( + options?: VirtualHardDisksListAllOptionalParams, + ) => PagedAsyncIterableIterator; + /** Lists all of the virtual hard disks in the specified resource group. Use the nextLink property in the response to get the next page of virtual hard disks. */ + listByResourceGroup: ( + resourceGroupName: string, + options?: VirtualHardDisksListByResourceGroupOptionalParams, + ) => PagedAsyncIterableIterator; + /** The operation to delete a virtual hard disk. */ + /** + * @fixme delete is a reserved word that cannot be used as an operation name. + * Please add @clientName("clientName") or @clientName("", "javascript") + * to the operation to override the generated name. + */ + delete: ( + resourceGroupName: string, + virtualHardDiskName: string, + options?: VirtualHardDisksDeleteOptionalParams, + ) => PollerLike, void>; + /** The operation to update a virtual hard disk. */ + update: ( + resourceGroupName: string, + virtualHardDiskName: string, + properties: VirtualHardDisksUpdateRequest, + options?: VirtualHardDisksUpdateOptionalParams, + ) => PollerLike, VirtualHardDisk>; + /** The operation to create or update a virtual hard disk. Please note some properties can be set only during virtual hard disk creation. */ + createOrUpdate: ( + resourceGroupName: string, + virtualHardDiskName: string, + resource: VirtualHardDisk, + options?: VirtualHardDisksCreateOrUpdateOptionalParams, + ) => PollerLike, VirtualHardDisk>; + /** Gets a virtual hard disk */ + get: ( + resourceGroupName: string, + virtualHardDiskName: string, + options?: VirtualHardDisksGetOptionalParams, + ) => Promise; +} + +function _getVirtualHardDisks(context: AzureStackHCIVMManagementContext) { + return { + upload: ( + resourceGroupName: string, + virtualHardDiskName: string, + body: VirtualHardDiskUploadRequest, + options?: VirtualHardDisksUploadOptionalParams, + ) => upload(context, resourceGroupName, virtualHardDiskName, body, options), + listAll: (options?: VirtualHardDisksListAllOptionalParams) => listAll(context, options), + listByResourceGroup: ( + resourceGroupName: string, + options?: VirtualHardDisksListByResourceGroupOptionalParams, + ) => listByResourceGroup(context, resourceGroupName, options), + delete: ( + resourceGroupName: string, + virtualHardDiskName: string, + options?: VirtualHardDisksDeleteOptionalParams, + ) => $delete(context, resourceGroupName, virtualHardDiskName, options), + update: ( + resourceGroupName: string, + virtualHardDiskName: string, + properties: VirtualHardDisksUpdateRequest, + options?: VirtualHardDisksUpdateOptionalParams, + ) => update(context, resourceGroupName, virtualHardDiskName, properties, options), + createOrUpdate: ( + resourceGroupName: string, + virtualHardDiskName: string, + resource: VirtualHardDisk, + options?: VirtualHardDisksCreateOrUpdateOptionalParams, + ) => createOrUpdate(context, resourceGroupName, virtualHardDiskName, resource, options), + get: ( + resourceGroupName: string, + virtualHardDiskName: string, + options?: VirtualHardDisksGetOptionalParams, + ) => get(context, resourceGroupName, virtualHardDiskName, options), + }; +} + +export function _getVirtualHardDisksOperations( + context: AzureStackHCIVMManagementContext, +): VirtualHardDisksOperations { + return { + ..._getVirtualHardDisks(context), + }; +} diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/src/classic/virtualMachineInstances/index.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/src/classic/virtualMachineInstances/index.ts new file mode 100644 index 000000000000..21d28c13295d --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/src/classic/virtualMachineInstances/index.ts @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { AzureStackHCIVMManagementContext } from "../../api/azureStackHcivmManagementContext.js"; +import { + save, + pause, + restart, + stop, + start, + list, + $delete, + update, + createOrUpdate, + get, +} from "../../api/virtualMachineInstances/operations.js"; +import { + VirtualMachineInstancesSaveOptionalParams, + VirtualMachineInstancesPauseOptionalParams, + VirtualMachineInstancesRestartOptionalParams, + VirtualMachineInstancesStopOptionalParams, + VirtualMachineInstancesStartOptionalParams, + VirtualMachineInstancesListOptionalParams, + VirtualMachineInstancesDeleteOptionalParams, + VirtualMachineInstancesUpdateOptionalParams, + VirtualMachineInstancesCreateOrUpdateOptionalParams, + VirtualMachineInstancesGetOptionalParams, +} from "../../api/virtualMachineInstances/options.js"; +import { + VirtualMachineInstance, + VirtualMachineInstanceUpdateRequest, +} from "../../models/models.js"; +import { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; +import { PollerLike, OperationState } from "@azure/core-lro"; + +/** Interface representing a VirtualMachineInstances operations. */ +export interface VirtualMachineInstancesOperations { + /** The operation to save a virtual machine instance. */ + save: ( + resourceUri: string, + options?: VirtualMachineInstancesSaveOptionalParams, + ) => PollerLike, void>; + /** The operation to pause a virtual machine instance. */ + pause: ( + resourceUri: string, + options?: VirtualMachineInstancesPauseOptionalParams, + ) => PollerLike, void>; + /** The operation to restart a virtual machine instance. */ + restart: ( + resourceUri: string, + options?: VirtualMachineInstancesRestartOptionalParams, + ) => PollerLike, void>; + /** The operation to stop a virtual machine instance. */ + stop: ( + resourceUri: string, + options?: VirtualMachineInstancesStopOptionalParams, + ) => PollerLike, void>; + /** The operation to start a virtual machine instance. */ + start: ( + resourceUri: string, + options?: VirtualMachineInstancesStartOptionalParams, + ) => PollerLike, void>; + /** Lists all of the virtual machine instances within the specified parent resource. */ + list: ( + resourceUri: string, + options?: VirtualMachineInstancesListOptionalParams, + ) => PagedAsyncIterableIterator; + /** The operation to delete a virtual machine instance. */ + /** + * @fixme delete is a reserved word that cannot be used as an operation name. + * Please add @clientName("clientName") or @clientName("", "javascript") + * to the operation to override the generated name. + */ + delete: ( + resourceUri: string, + options?: VirtualMachineInstancesDeleteOptionalParams, + ) => PollerLike, void>; + /** The operation to update a virtual machine instance. */ + update: ( + resourceUri: string, + properties: VirtualMachineInstanceUpdateRequest, + options?: VirtualMachineInstancesUpdateOptionalParams, + ) => PollerLike, VirtualMachineInstance>; + /** The operation to create or update a virtual machine instance. Please note some properties can be set only during virtual machine instance creation. */ + createOrUpdate: ( + resourceUri: string, + resource: VirtualMachineInstance, + options?: VirtualMachineInstancesCreateOrUpdateOptionalParams, + ) => PollerLike, VirtualMachineInstance>; + /** Gets a virtual machine instance */ + get: ( + resourceUri: string, + options?: VirtualMachineInstancesGetOptionalParams, + ) => Promise; +} + +function _getVirtualMachineInstances(context: AzureStackHCIVMManagementContext) { + return { + save: (resourceUri: string, options?: VirtualMachineInstancesSaveOptionalParams) => + save(context, resourceUri, options), + pause: (resourceUri: string, options?: VirtualMachineInstancesPauseOptionalParams) => + pause(context, resourceUri, options), + restart: (resourceUri: string, options?: VirtualMachineInstancesRestartOptionalParams) => + restart(context, resourceUri, options), + stop: (resourceUri: string, options?: VirtualMachineInstancesStopOptionalParams) => + stop(context, resourceUri, options), + start: (resourceUri: string, options?: VirtualMachineInstancesStartOptionalParams) => + start(context, resourceUri, options), + list: (resourceUri: string, options?: VirtualMachineInstancesListOptionalParams) => + list(context, resourceUri, options), + delete: (resourceUri: string, options?: VirtualMachineInstancesDeleteOptionalParams) => + $delete(context, resourceUri, options), + update: ( + resourceUri: string, + properties: VirtualMachineInstanceUpdateRequest, + options?: VirtualMachineInstancesUpdateOptionalParams, + ) => update(context, resourceUri, properties, options), + createOrUpdate: ( + resourceUri: string, + resource: VirtualMachineInstance, + options?: VirtualMachineInstancesCreateOrUpdateOptionalParams, + ) => createOrUpdate(context, resourceUri, resource, options), + get: (resourceUri: string, options?: VirtualMachineInstancesGetOptionalParams) => + get(context, resourceUri, options), + }; +} + +export function _getVirtualMachineInstancesOperations( + context: AzureStackHCIVMManagementContext, +): VirtualMachineInstancesOperations { + return { + ..._getVirtualMachineInstances(context), + }; +} diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/src/index.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/src/index.ts new file mode 100644 index 000000000000..19f7716a88de --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/src/index.ts @@ -0,0 +1,297 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { AzureClouds, AzureSupportedClouds } from "./static-helpers/cloudSettingHelpers.js"; +import { + PageSettings, + ContinuablePage, + PagedAsyncIterableIterator, +} from "./static-helpers/pagingHelpers.js"; + +export { AzureStackHCIVMManagementClient } from "./azureStackHcivmManagementClient.js"; +export { restorePoller, RestorePollerOptions } from "./restorePollerHelpers.js"; +export { + GalleryImage, + GalleryImageProperties, + KnownOperatingSystemTypes, + OperatingSystemTypes, + KnownCloudInitDataSource, + CloudInitDataSource, + KnownHyperVGeneration, + HyperVGeneration, + VmImageRepositoryCredentials, + GalleryImageIdentifier, + GalleryImageVersion, + GalleryImageVersionProperties, + GalleryImageVersionStorageProfile, + GalleryOSDiskImage, + KnownProvisioningStateEnum, + ProvisioningStateEnum, + GalleryImageStatus, + GalleryImageStatusProvisioningStatus, + KnownStatus, + Status, + GalleryImageStatusDownloadStatus, + ExtendedLocation, + KnownExtendedLocationTypes, + ExtendedLocationTypes, + TrackedResource, + Resource, + SystemData, + KnownCreatedByType, + CreatedByType, + ErrorResponse, + ErrorDetail, + ErrorAdditionalInfo, + GalleryImageTagsUpdate, + LogicalNetwork, + LogicalNetworkProperties, + LogicalNetworkPropertiesDhcpOptions, + Subnet, + SubnetProperties, + KnownIpAllocationMethodEnum, + IpAllocationMethodEnum, + SubnetIpConfigurationReference, + NetworkSecurityGroupArmReference, + RouteTable, + RouteTableProperties, + Route, + RouteProperties, + IPPool, + KnownIPPoolTypeEnum, + IPPoolTypeEnum, + IPPoolInfo, + LogicalNetworkStatus, + LogicalNetworkStatusProvisioningStatus, + KnownLogicalNetworkTypeEnum, + LogicalNetworkTypeEnum, + LogicalNetworksUpdateRequest, + MarketplaceGalleryImage, + MarketplaceGalleryImageProperties, + MarketplaceGalleryImageStatus, + MarketplaceGalleryImageStatusProvisioningStatus, + MarketplaceGalleryImageStatusDownloadStatus, + MarketplaceGalleryImageTagsUpdate, + NetworkInterface, + NetworkInterfaceProperties, + IPConfiguration, + IPConfigurationProperties, + LogicalNetworkArmReference, + InterfaceDNSSettings, + NetworkInterfaceStatus, + NetworkInterfaceStatusProvisioningStatus, + NetworkInterfacesUpdateRequest, + NetworkInterfacesUpdateProperties, + NetworkSecurityGroup, + NetworkSecurityGroupProperties, + NetworkInterfaceArmReference, + NetworkSecurityGroupStatus, + NetworkSecurityGroupStatusProvisioningStatus, + NetworkSecurityGroupTagsUpdate, + SecurityRule, + SecurityRuleProperties, + KnownSecurityRuleProtocol, + SecurityRuleProtocol, + KnownSecurityRuleAccess, + SecurityRuleAccess, + KnownSecurityRuleDirection, + SecurityRuleDirection, + ProxyResource, + StorageContainer, + StorageContainerProperties, + StorageContainerStatus, + StorageContainerStatusProvisioningStatus, + StorageContainerTagsUpdate, + VirtualHardDisk, + VirtualHardDiskProperties, + KnownDiskFileFormat, + DiskFileFormat, + VirtualHardDiskStatus, + VirtualHardDiskStatusProvisioningStatus, + VirtualHardDiskDownloadStatus, + VirtualHardDiskUploadStatus, + VirtualHardDisksUpdateRequest, + VirtualHardDisksUpdateProperties, + VirtualHardDiskUploadRequest, + VirtualHardDiskUploadResponse, + VirtualMachineInstance, + VirtualMachineInstanceProperties, + VirtualMachineInstancePropertiesHardwareProfile, + KnownVmSizeEnum, + VmSizeEnum, + VirtualMachineInstancePropertiesHardwareProfileDynamicMemoryConfig, + VirtualMachineInstancePropertiesHardwareProfileVirtualMachineGPU, + KnownGpuAssignmentTypeEnum, + GpuAssignmentTypeEnum, + VirtualMachineInstancePropertiesPlacementProfile, + VirtualMachineInstancePropertiesNetworkProfile, + VirtualMachineInstancePropertiesOsProfile, + VirtualMachineInstancePropertiesOsProfileLinuxConfiguration, + SshConfiguration, + SshPublicKey, + VirtualMachineInstancePropertiesOsProfileWindowsConfiguration, + VirtualMachineInstancePropertiesSecurityProfile, + VirtualMachineInstancePropertiesSecurityProfileUefiSettings, + KnownSecurityTypes, + SecurityTypes, + VirtualMachineInstancePropertiesStorageProfile, + VirtualHardDiskArmReference, + ImageArmReference, + VirtualMachineInstancePropertiesStorageProfileOsDisk, + VirtualMachineInstanceManagedDiskParameters, + VMDiskSecurityProfile, + KnownSecurityEncryptionType, + SecurityEncryptionType, + HttpProxyConfiguration, + VirtualMachineInstanceView, + VirtualMachineConfigAgentInstanceView, + InstanceViewStatus, + KnownStatusLevelTypes, + StatusLevelTypes, + VirtualMachineInstanceStatus, + KnownPowerStateEnum, + PowerStateEnum, + VirtualMachineInstanceStatusProvisioningStatus, + GuestAgentInstallStatus, + KnownStatusTypes, + StatusTypes, + ManagedServiceIdentity, + KnownManagedServiceIdentityType, + ManagedServiceIdentityType, + UserAssignedIdentity, + ExtensionResource, + VirtualMachineInstanceUpdateRequest, + VirtualMachineInstanceUpdateProperties, + HardwareProfileUpdate, + StorageProfileUpdate, + NetworkProfileUpdate, + OsProfileUpdate, + OsProfileUpdateLinuxConfiguration, + OsProfileUpdateWindowsConfiguration, + Identity, + HybridIdentityMetadata, + HybridIdentityMetadataProperties, + AttestationStatus, + AttestationStatusProperties, + KnownAttestSecureBootPropertyEnum, + AttestSecureBootPropertyEnum, + KnownAttestCertPropertyEnum, + AttestCertPropertyEnum, + KnownAttestBootIntegrityPropertyEnum, + AttestBootIntegrityPropertyEnum, + KnownAttestHealthStatusEnum, + AttestHealthStatusEnum, + KnownAttestHWPlatformEnum, + AttestHWPlatformEnum, + KnownAttestDiskSecurityEncryptionTypeEnum, + AttestDiskSecurityEncryptionTypeEnum, + GuestAgent, + GuestAgentProperties, + GuestCredential, + KnownProvisioningAction, + ProvisioningAction, + KnownVersions, +} from "./models/index.js"; +export { AzureStackHCIVMManagementClientOptionalParams } from "./api/index.js"; +export { AttestationStatusesGetOptionalParams } from "./api/attestationStatuses/index.js"; +export { + GalleryImagesListAllOptionalParams, + GalleryImagesListByResourceGroupOptionalParams, + GalleryImagesDeleteOptionalParams, + GalleryImagesUpdateOptionalParams, + GalleryImagesCreateOrUpdateOptionalParams, + GalleryImagesGetOptionalParams, +} from "./api/galleryImages/index.js"; +export { + GuestAgentsListByVirtualMachineInstanceOptionalParams, + GuestAgentsDeleteOptionalParams, + GuestAgentsCreateOptionalParams, + GuestAgentsGetOptionalParams, +} from "./api/guestAgents/index.js"; +export { + HybridIdentityMetadataListByVirtualMachineInstanceOptionalParams, + HybridIdentityMetadataGetOptionalParams, +} from "./api/hybridIdentityMetadata/index.js"; +export { + LogicalNetworksListAllOptionalParams, + LogicalNetworksListByResourceGroupOptionalParams, + LogicalNetworksDeleteOptionalParams, + LogicalNetworksUpdateOptionalParams, + LogicalNetworksCreateOrUpdateOptionalParams, + LogicalNetworksGetOptionalParams, +} from "./api/logicalNetworks/index.js"; +export { + MarketplaceGalleryImagesListAllOptionalParams, + MarketplaceGalleryImagesListByResourceGroupOptionalParams, + MarketplaceGalleryImagesDeleteOptionalParams, + MarketplaceGalleryImagesUpdateOptionalParams, + MarketplaceGalleryImagesCreateOrUpdateOptionalParams, + MarketplaceGalleryImagesGetOptionalParams, +} from "./api/marketplaceGalleryImages/index.js"; +export { + NetworkInterfacesListAllOptionalParams, + NetworkInterfacesListByResourceGroupOptionalParams, + NetworkInterfacesDeleteOptionalParams, + NetworkInterfacesUpdateOptionalParams, + NetworkInterfacesCreateOrUpdateOptionalParams, + NetworkInterfacesGetOptionalParams, +} from "./api/networkInterfaces/index.js"; +export { + NetworkSecurityGroupsListAllOptionalParams, + NetworkSecurityGroupsListByResourceGroupOptionalParams, + NetworkSecurityGroupsDeleteOptionalParams, + NetworkSecurityGroupsUpdateTagsOptionalParams, + NetworkSecurityGroupsCreateOrUpdateOptionalParams, + NetworkSecurityGroupsGetOptionalParams, +} from "./api/networkSecurityGroups/index.js"; +export { + SecurityRulesListByNetworkSecurityGroupOptionalParams, + SecurityRulesDeleteOptionalParams, + SecurityRulesCreateOrUpdateOptionalParams, + SecurityRulesGetOptionalParams, +} from "./api/securityRules/index.js"; +export { + StorageContainersListAllOptionalParams, + StorageContainersListByResourceGroupOptionalParams, + StorageContainersDeleteOptionalParams, + StorageContainersUpdateOptionalParams, + StorageContainersCreateOrUpdateOptionalParams, + StorageContainersGetOptionalParams, +} from "./api/storageContainers/index.js"; +export { + VirtualHardDisksUploadOptionalParams, + VirtualHardDisksListAllOptionalParams, + VirtualHardDisksListByResourceGroupOptionalParams, + VirtualHardDisksDeleteOptionalParams, + VirtualHardDisksUpdateOptionalParams, + VirtualHardDisksCreateOrUpdateOptionalParams, + VirtualHardDisksGetOptionalParams, +} from "./api/virtualHardDisks/index.js"; +export { + VirtualMachineInstancesSaveOptionalParams, + VirtualMachineInstancesPauseOptionalParams, + VirtualMachineInstancesRestartOptionalParams, + VirtualMachineInstancesStopOptionalParams, + VirtualMachineInstancesStartOptionalParams, + VirtualMachineInstancesListOptionalParams, + VirtualMachineInstancesDeleteOptionalParams, + VirtualMachineInstancesUpdateOptionalParams, + VirtualMachineInstancesCreateOrUpdateOptionalParams, + VirtualMachineInstancesGetOptionalParams, +} from "./api/virtualMachineInstances/index.js"; +export { + AttestationStatusesOperations, + GalleryImagesOperations, + GuestAgentsOperations, + HybridIdentityMetadataOperations, + LogicalNetworksOperations, + MarketplaceGalleryImagesOperations, + NetworkInterfacesOperations, + NetworkSecurityGroupsOperations, + SecurityRulesOperations, + StorageContainersOperations, + VirtualHardDisksOperations, + VirtualMachineInstancesOperations, +} from "./classic/index.js"; +export { PageSettings, ContinuablePage, PagedAsyncIterableIterator }; +export { AzureClouds, AzureSupportedClouds }; diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/src/logger.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/src/logger.ts new file mode 100644 index 000000000000..07fbe9dfd01e --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/src/logger.ts @@ -0,0 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { createClientLogger } from "@azure/logger"; +export const logger = createClientLogger("arm-azurestackhcivm"); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/src/models/index.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/src/models/index.ts new file mode 100644 index 000000000000..97f3daa39153 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/src/models/index.ts @@ -0,0 +1,185 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { + GalleryImage, + GalleryImageProperties, + KnownOperatingSystemTypes, + OperatingSystemTypes, + KnownCloudInitDataSource, + CloudInitDataSource, + KnownHyperVGeneration, + HyperVGeneration, + VmImageRepositoryCredentials, + GalleryImageIdentifier, + GalleryImageVersion, + GalleryImageVersionProperties, + GalleryImageVersionStorageProfile, + GalleryOSDiskImage, + KnownProvisioningStateEnum, + ProvisioningStateEnum, + GalleryImageStatus, + GalleryImageStatusProvisioningStatus, + KnownStatus, + Status, + GalleryImageStatusDownloadStatus, + ExtendedLocation, + KnownExtendedLocationTypes, + ExtendedLocationTypes, + TrackedResource, + Resource, + SystemData, + KnownCreatedByType, + CreatedByType, + ErrorResponse, + ErrorDetail, + ErrorAdditionalInfo, + GalleryImageTagsUpdate, + LogicalNetwork, + LogicalNetworkProperties, + LogicalNetworkPropertiesDhcpOptions, + Subnet, + SubnetProperties, + KnownIpAllocationMethodEnum, + IpAllocationMethodEnum, + SubnetIpConfigurationReference, + NetworkSecurityGroupArmReference, + RouteTable, + RouteTableProperties, + Route, + RouteProperties, + IPPool, + KnownIPPoolTypeEnum, + IPPoolTypeEnum, + IPPoolInfo, + LogicalNetworkStatus, + LogicalNetworkStatusProvisioningStatus, + KnownLogicalNetworkTypeEnum, + LogicalNetworkTypeEnum, + LogicalNetworksUpdateRequest, + MarketplaceGalleryImage, + MarketplaceGalleryImageProperties, + MarketplaceGalleryImageStatus, + MarketplaceGalleryImageStatusProvisioningStatus, + MarketplaceGalleryImageStatusDownloadStatus, + MarketplaceGalleryImageTagsUpdate, + NetworkInterface, + NetworkInterfaceProperties, + IPConfiguration, + IPConfigurationProperties, + LogicalNetworkArmReference, + InterfaceDNSSettings, + NetworkInterfaceStatus, + NetworkInterfaceStatusProvisioningStatus, + NetworkInterfacesUpdateRequest, + NetworkInterfacesUpdateProperties, + NetworkSecurityGroup, + NetworkSecurityGroupProperties, + NetworkInterfaceArmReference, + NetworkSecurityGroupStatus, + NetworkSecurityGroupStatusProvisioningStatus, + NetworkSecurityGroupTagsUpdate, + SecurityRule, + SecurityRuleProperties, + KnownSecurityRuleProtocol, + SecurityRuleProtocol, + KnownSecurityRuleAccess, + SecurityRuleAccess, + KnownSecurityRuleDirection, + SecurityRuleDirection, + ProxyResource, + StorageContainer, + StorageContainerProperties, + StorageContainerStatus, + StorageContainerStatusProvisioningStatus, + StorageContainerTagsUpdate, + VirtualHardDisk, + VirtualHardDiskProperties, + KnownDiskFileFormat, + DiskFileFormat, + VirtualHardDiskStatus, + VirtualHardDiskStatusProvisioningStatus, + VirtualHardDiskDownloadStatus, + VirtualHardDiskUploadStatus, + VirtualHardDisksUpdateRequest, + VirtualHardDisksUpdateProperties, + VirtualHardDiskUploadRequest, + VirtualHardDiskUploadResponse, + VirtualMachineInstance, + VirtualMachineInstanceProperties, + VirtualMachineInstancePropertiesHardwareProfile, + KnownVmSizeEnum, + VmSizeEnum, + VirtualMachineInstancePropertiesHardwareProfileDynamicMemoryConfig, + VirtualMachineInstancePropertiesHardwareProfileVirtualMachineGPU, + KnownGpuAssignmentTypeEnum, + GpuAssignmentTypeEnum, + VirtualMachineInstancePropertiesPlacementProfile, + VirtualMachineInstancePropertiesNetworkProfile, + VirtualMachineInstancePropertiesOsProfile, + VirtualMachineInstancePropertiesOsProfileLinuxConfiguration, + SshConfiguration, + SshPublicKey, + VirtualMachineInstancePropertiesOsProfileWindowsConfiguration, + VirtualMachineInstancePropertiesSecurityProfile, + VirtualMachineInstancePropertiesSecurityProfileUefiSettings, + KnownSecurityTypes, + SecurityTypes, + VirtualMachineInstancePropertiesStorageProfile, + VirtualHardDiskArmReference, + ImageArmReference, + VirtualMachineInstancePropertiesStorageProfileOsDisk, + VirtualMachineInstanceManagedDiskParameters, + VMDiskSecurityProfile, + KnownSecurityEncryptionType, + SecurityEncryptionType, + HttpProxyConfiguration, + VirtualMachineInstanceView, + VirtualMachineConfigAgentInstanceView, + InstanceViewStatus, + KnownStatusLevelTypes, + StatusLevelTypes, + VirtualMachineInstanceStatus, + KnownPowerStateEnum, + PowerStateEnum, + VirtualMachineInstanceStatusProvisioningStatus, + GuestAgentInstallStatus, + KnownStatusTypes, + StatusTypes, + ManagedServiceIdentity, + KnownManagedServiceIdentityType, + ManagedServiceIdentityType, + UserAssignedIdentity, + ExtensionResource, + VirtualMachineInstanceUpdateRequest, + VirtualMachineInstanceUpdateProperties, + HardwareProfileUpdate, + StorageProfileUpdate, + NetworkProfileUpdate, + OsProfileUpdate, + OsProfileUpdateLinuxConfiguration, + OsProfileUpdateWindowsConfiguration, + Identity, + HybridIdentityMetadata, + HybridIdentityMetadataProperties, + AttestationStatus, + AttestationStatusProperties, + KnownAttestSecureBootPropertyEnum, + AttestSecureBootPropertyEnum, + KnownAttestCertPropertyEnum, + AttestCertPropertyEnum, + KnownAttestBootIntegrityPropertyEnum, + AttestBootIntegrityPropertyEnum, + KnownAttestHealthStatusEnum, + AttestHealthStatusEnum, + KnownAttestHWPlatformEnum, + AttestHWPlatformEnum, + KnownAttestDiskSecurityEncryptionTypeEnum, + AttestDiskSecurityEncryptionTypeEnum, + GuestAgent, + GuestAgentProperties, + GuestCredential, + KnownProvisioningAction, + ProvisioningAction, + KnownVersions, +} from "./models.js"; diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/src/models/models.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/src/models/models.ts new file mode 100644 index 000000000000..cb6eef1842af --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/src/models/models.ts @@ -0,0 +1,4429 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +/** The gallery images resource definition. */ +export interface GalleryImage extends TrackedResource { + /** The resource-specific properties for this resource. */ + properties?: GalleryImageProperties; + /** The extendedLocation of the resource. */ + extendedLocation?: ExtendedLocation; +} + +export function galleryImageSerializer(item: GalleryImage): any { + return { + tags: item["tags"], + location: item["location"], + properties: !item["properties"] + ? item["properties"] + : galleryImagePropertiesSerializer(item["properties"]), + extendedLocation: !item["extendedLocation"] + ? item["extendedLocation"] + : extendedLocationSerializer(item["extendedLocation"]), + }; +} + +export function galleryImageDeserializer(item: any): GalleryImage { + return { + tags: item["tags"], + location: item["location"], + id: item["id"], + name: item["name"], + type: item["type"], + systemData: !item["systemData"] + ? item["systemData"] + : systemDataDeserializer(item["systemData"]), + properties: !item["properties"] + ? item["properties"] + : galleryImagePropertiesDeserializer(item["properties"]), + extendedLocation: !item["extendedLocation"] + ? item["extendedLocation"] + : extendedLocationDeserializer(item["extendedLocation"]), + }; +} + +/** Properties under the gallery image resource */ +export interface GalleryImageProperties { + /** Storage ContainerID of the storage container to be used for gallery image */ + containerId?: string; + /** location of the image the gallery image should be created from */ + imagePath?: string; + /** Operating system type that the gallery image uses [Windows, Linux] */ + osType: OperatingSystemTypes; + /** Datasource for the gallery image when provisioning with cloud-init [NoCloud, Azure] */ + cloudInitDataSource?: CloudInitDataSource; + /** The hypervisor generation of the Virtual Machine [V1, V2] */ + hyperVGeneration?: HyperVGeneration; + /** The credentials used to login to the image repository that has access to the specified image */ + vmImageRepositoryCredentials?: VmImageRepositoryCredentials; + /** This is the gallery image definition identifier. */ + identifier?: GalleryImageIdentifier; + /** Specifies information about the gallery image version that you want to create or update. */ + version?: GalleryImageVersion; + /** Provisioning state of the gallery image. */ + readonly provisioningState?: ProvisioningStateEnum; + /** The observed state of gallery images */ + readonly status?: GalleryImageStatus; + /** Resource ID of the source virtual machine from whose OS disk the gallery image is created. */ + sourceVirtualMachineId?: string; +} + +export function galleryImagePropertiesSerializer(item: GalleryImageProperties): any { + return { + containerId: item["containerId"], + imagePath: item["imagePath"], + osType: item["osType"], + cloudInitDataSource: item["cloudInitDataSource"], + hyperVGeneration: item["hyperVGeneration"], + vmImageRepositoryCredentials: !item["vmImageRepositoryCredentials"] + ? item["vmImageRepositoryCredentials"] + : vmImageRepositoryCredentialsSerializer(item["vmImageRepositoryCredentials"]), + identifier: !item["identifier"] + ? item["identifier"] + : galleryImageIdentifierSerializer(item["identifier"]), + version: !item["version"] ? item["version"] : galleryImageVersionSerializer(item["version"]), + sourceVirtualMachineId: item["sourceVirtualMachineId"], + }; +} + +export function galleryImagePropertiesDeserializer(item: any): GalleryImageProperties { + return { + containerId: item["containerId"], + imagePath: item["imagePath"], + osType: item["osType"], + cloudInitDataSource: item["cloudInitDataSource"], + hyperVGeneration: item["hyperVGeneration"], + vmImageRepositoryCredentials: !item["vmImageRepositoryCredentials"] + ? item["vmImageRepositoryCredentials"] + : vmImageRepositoryCredentialsDeserializer(item["vmImageRepositoryCredentials"]), + identifier: !item["identifier"] + ? item["identifier"] + : galleryImageIdentifierDeserializer(item["identifier"]), + version: !item["version"] ? item["version"] : galleryImageVersionDeserializer(item["version"]), + provisioningState: item["provisioningState"], + status: !item["status"] ? item["status"] : galleryImageStatusDeserializer(item["status"]), + sourceVirtualMachineId: item["sourceVirtualMachineId"], + }; +} + +/** Operating system type that the gallery image uses [Windows, Linux] */ +export enum KnownOperatingSystemTypes { + /** Windows operating system */ + Windows = "Windows", + /** Linux operating system */ + Linux = "Linux", +} + +/** + * Operating system type that the gallery image uses [Windows, Linux] \ + * {@link KnownOperatingSystemTypes} can be used interchangeably with OperatingSystemTypes, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Windows**: Windows operating system \ + * **Linux**: Linux operating system + */ +export type OperatingSystemTypes = string; + +/** Datasource for the gallery image when provisioning with cloud-init [NoCloud, Azure] */ +export enum KnownCloudInitDataSource { + /** NoCloud is used as the datasource */ + NoCloud = "NoCloud", + /** Azure is used as the datasource */ + Azure = "Azure", +} + +/** + * Datasource for the gallery image when provisioning with cloud-init [NoCloud, Azure] \ + * {@link KnownCloudInitDataSource} can be used interchangeably with CloudInitDataSource, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **NoCloud**: NoCloud is used as the datasource \ + * **Azure**: Azure is used as the datasource + */ +export type CloudInitDataSource = string; + +/** The hypervisor generation of the Virtual Machine [V1, V2] */ +export enum KnownHyperVGeneration { + /** Generation 1 (V1) hypervisor */ + V1 = "V1", + /** Generation 2 (V2) hypervisor */ + V2 = "V2", +} + +/** + * The hypervisor generation of the Virtual Machine [V1, V2] \ + * {@link KnownHyperVGeneration} can be used interchangeably with HyperVGeneration, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **V1**: Generation 1 (V1) hypervisor \ + * **V2**: Generation 2 (V2) hypervisor + */ +export type HyperVGeneration = string; + +/** The credentials used to login to the image repository that has access to the specified image */ +export interface VmImageRepositoryCredentials { + /** Username for accessing image repository */ + username: string; + /** Password for accessing image repository */ + password: string; +} + +export function vmImageRepositoryCredentialsSerializer(item: VmImageRepositoryCredentials): any { + return { username: item["username"], password: item["password"] }; +} + +export function vmImageRepositoryCredentialsDeserializer(item: any): VmImageRepositoryCredentials { + return { + username: item["username"], + password: item["password"], + }; +} + +/** This is the gallery image definition identifier. */ +export interface GalleryImageIdentifier { + /** The name of the gallery image definition publisher. */ + publisher: string; + /** The name of the gallery image definition offer. */ + offer: string; + /** The name of the gallery image definition SKU. */ + sku: string; +} + +export function galleryImageIdentifierSerializer(item: GalleryImageIdentifier): any { + return { + publisher: item["publisher"], + offer: item["offer"], + sku: item["sku"], + }; +} + +export function galleryImageIdentifierDeserializer(item: any): GalleryImageIdentifier { + return { + publisher: item["publisher"], + offer: item["offer"], + sku: item["sku"], + }; +} + +/** Specifies information about the gallery image version that you want to create or update. */ +export interface GalleryImageVersion { + /** This is the version of the gallery image. */ + name?: string; + /** Describes the properties of a gallery image version. */ + properties?: GalleryImageVersionProperties; +} + +export function galleryImageVersionSerializer(item: GalleryImageVersion): any { + return { + name: item["name"], + properties: !item["properties"] + ? item["properties"] + : galleryImageVersionPropertiesSerializer(item["properties"]), + }; +} + +export function galleryImageVersionDeserializer(item: any): GalleryImageVersion { + return { + name: item["name"], + properties: !item["properties"] + ? item["properties"] + : galleryImageVersionPropertiesDeserializer(item["properties"]), + }; +} + +/** Describes the properties of a gallery image version. */ +export interface GalleryImageVersionProperties { + /** This is the storage profile of a Gallery Image Version. */ + storageProfile: GalleryImageVersionStorageProfile; +} + +export function galleryImageVersionPropertiesSerializer(item: GalleryImageVersionProperties): any { + return { + storageProfile: galleryImageVersionStorageProfileSerializer(item["storageProfile"]), + }; +} + +export function galleryImageVersionPropertiesDeserializer( + item: any, +): GalleryImageVersionProperties { + return { + storageProfile: galleryImageVersionStorageProfileDeserializer(item["storageProfile"]), + }; +} + +/** This is the storage profile of a Gallery Image Version. */ +export interface GalleryImageVersionStorageProfile { + /** This is the OS disk image. */ + osDiskImage?: GalleryOSDiskImage; +} + +export function galleryImageVersionStorageProfileSerializer( + item: GalleryImageVersionStorageProfile, +): any { + return { + osDiskImage: !item["osDiskImage"] + ? item["osDiskImage"] + : galleryOSDiskImageSerializer(item["osDiskImage"]), + }; +} + +export function galleryImageVersionStorageProfileDeserializer( + item: any, +): GalleryImageVersionStorageProfile { + return { + osDiskImage: !item["osDiskImage"] + ? item["osDiskImage"] + : galleryOSDiskImageDeserializer(item["osDiskImage"]), + }; +} + +/** This is the OS disk image. */ +export interface GalleryOSDiskImage { + /** This property indicates the size of the VHD to be created. */ + readonly sizeInMB?: number; +} + +export function galleryOSDiskImageSerializer(item: GalleryOSDiskImage): any { + return item; +} + +export function galleryOSDiskImageDeserializer(item: any): GalleryOSDiskImage { + return { + sizeInMB: item["sizeInMB"], + }; +} + +/** Provisioning state of the resource. */ +export enum KnownProvisioningStateEnum { + /** Provisioning has succeeded */ + Succeeded = "Succeeded", + /** Provisioning has failed */ + Failed = "Failed", + /** Provisioning is in progress */ + InProgress = "InProgress", + /** Provisioning has been accepted */ + Accepted = "Accepted", + /** Deletion of the resource is in progress */ + Deleting = "Deleting", + /** Provisioning has been canceled */ + Canceled = "Canceled", +} + +/** + * Provisioning state of the resource. \ + * {@link KnownProvisioningStateEnum} can be used interchangeably with ProvisioningStateEnum, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Succeeded**: Provisioning has succeeded \ + * **Failed**: Provisioning has failed \ + * **InProgress**: Provisioning is in progress \ + * **Accepted**: Provisioning has been accepted \ + * **Deleting**: Deletion of the resource is in progress \ + * **Canceled**: Provisioning has been canceled + */ +export type ProvisioningStateEnum = string; + +/** The observed state of gallery images */ +export interface GalleryImageStatus { + /** GalleryImage provisioning error code */ + errorCode?: string; + /** Descriptive error message */ + errorMessage?: string; + /** provisioning status of the gallery image */ + provisioningStatus?: GalleryImageStatusProvisioningStatus; + /** The download status of the gallery image */ + downloadStatus?: GalleryImageStatusDownloadStatus; + /** The progress of the operation in percentage */ + progressPercentage?: number; +} + +export function galleryImageStatusDeserializer(item: any): GalleryImageStatus { + return { + errorCode: item["errorCode"], + errorMessage: item["errorMessage"], + provisioningStatus: !item["provisioningStatus"] + ? item["provisioningStatus"] + : galleryImageStatusProvisioningStatusDeserializer(item["provisioningStatus"]), + downloadStatus: !item["downloadStatus"] + ? item["downloadStatus"] + : galleryImageStatusDownloadStatusDeserializer(item["downloadStatus"]), + progressPercentage: item["progressPercentage"], + }; +} + +/** The status of the operation performed on the gallery image */ +export interface GalleryImageStatusProvisioningStatus { + /** The ID of the operation performed on the gallery image */ + operationId?: string; + /** The status of the operation performed on the gallery image [Succeeded, Failed, InProgress] */ + status?: Status; +} + +export function galleryImageStatusProvisioningStatusDeserializer( + item: any, +): GalleryImageStatusProvisioningStatus { + return { + operationId: item["operationId"], + status: item["status"], + }; +} + +/** The status of the operation performed on the resource [Succeeded, Failed, InProgress] */ +export enum KnownStatus { + /** Operation succeeded */ + Succeeded = "Succeeded", + /** Operation failed */ + Failed = "Failed", + /** Operation is in progress */ + InProgress = "InProgress", +} + +/** + * The status of the operation performed on the resource [Succeeded, Failed, InProgress] \ + * {@link KnownStatus} can be used interchangeably with Status, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Succeeded**: Operation succeeded \ + * **Failed**: Operation failed \ + * **InProgress**: Operation is in progress + */ +export type Status = string; + +/** The download status of the gallery image */ +export interface GalleryImageStatusDownloadStatus { + /** The downloaded sized of the image in MB */ + downloadSizeInMB?: number; +} + +export function galleryImageStatusDownloadStatusDeserializer( + item: any, +): GalleryImageStatusDownloadStatus { + return { + downloadSizeInMB: item["downloadSizeInMB"], + }; +} + +/** The complex type of the extended location. */ +export interface ExtendedLocation { + /** The name of the extended location. */ + name?: string; + /** The type of the extended location. */ + type?: ExtendedLocationTypes; +} + +export function extendedLocationSerializer(item: ExtendedLocation): any { + return { name: item["name"], type: item["type"] }; +} + +export function extendedLocationDeserializer(item: any): ExtendedLocation { + return { + name: item["name"], + type: item["type"], + }; +} + +/** The type of extendedLocation. */ +export enum KnownExtendedLocationTypes { + /** Custom extended location type */ + CustomLocation = "CustomLocation", +} + +/** + * The type of extendedLocation. \ + * {@link KnownExtendedLocationTypes} can be used interchangeably with ExtendedLocationTypes, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **CustomLocation**: Custom extended location type + */ +export type ExtendedLocationTypes = string; + +/** The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location' */ +export interface TrackedResource extends Resource { + /** Resource tags. */ + tags?: Record; + /** The geo-location where the resource lives */ + location: string; +} + +export function trackedResourceSerializer(item: TrackedResource): any { + return { tags: item["tags"], location: item["location"] }; +} + +export function trackedResourceDeserializer(item: any): TrackedResource { + return { + id: item["id"], + name: item["name"], + type: item["type"], + systemData: !item["systemData"] + ? item["systemData"] + : systemDataDeserializer(item["systemData"]), + tags: item["tags"], + location: item["location"], + }; +} + +/** Common fields that are returned in the response for all Azure Resource Manager resources */ +export interface Resource { + /** Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} */ + readonly id?: string; + /** The name of the resource */ + readonly name?: string; + /** The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" */ + readonly type?: string; + /** Azure Resource Manager metadata containing createdBy and modifiedBy information. */ + readonly systemData?: SystemData; +} + +export function resourceSerializer(item: Resource): any { + return item; +} + +export function resourceDeserializer(item: any): Resource { + return { + id: item["id"], + name: item["name"], + type: item["type"], + systemData: !item["systemData"] + ? item["systemData"] + : systemDataDeserializer(item["systemData"]), + }; +} + +/** Metadata pertaining to creation and last modification of the resource. */ +export interface SystemData { + /** The identity that created the resource. */ + createdBy?: string; + /** The type of identity that created the resource. */ + createdByType?: CreatedByType; + /** The timestamp of resource creation (UTC). */ + createdAt?: Date; + /** The identity that last modified the resource. */ + lastModifiedBy?: string; + /** The type of identity that last modified the resource. */ + lastModifiedByType?: CreatedByType; + /** The timestamp of resource last modification (UTC) */ + lastModifiedAt?: Date; +} + +export function systemDataDeserializer(item: any): SystemData { + return { + createdBy: item["createdBy"], + createdByType: item["createdByType"], + createdAt: !item["createdAt"] ? item["createdAt"] : new Date(item["createdAt"]), + lastModifiedBy: item["lastModifiedBy"], + lastModifiedByType: item["lastModifiedByType"], + lastModifiedAt: !item["lastModifiedAt"] + ? item["lastModifiedAt"] + : new Date(item["lastModifiedAt"]), + }; +} + +/** The kind of entity that created the resource. */ +export enum KnownCreatedByType { + /** The entity was created by a user. */ + User = "User", + /** The entity was created by an application. */ + Application = "Application", + /** The entity was created by a managed identity. */ + ManagedIdentity = "ManagedIdentity", + /** The entity was created by a key. */ + Key = "Key", +} + +/** + * The kind of entity that created the resource. \ + * {@link KnowncreatedByType} can be used interchangeably with createdByType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **User**: The entity was created by a user. \ + * **Application**: The entity was created by an application. \ + * **ManagedIdentity**: The entity was created by a managed identity. \ + * **Key**: The entity was created by a key. + */ +export type CreatedByType = string; + +/** Common error response for all Azure Resource Manager APIs to return error details for failed operations. */ +export interface ErrorResponse { + /** The error object. */ + error?: ErrorDetail; +} + +export function errorResponseDeserializer(item: any): ErrorResponse { + return { + error: !item["error"] ? item["error"] : errorDetailDeserializer(item["error"]), + }; +} + +/** The error detail. */ +export interface ErrorDetail { + /** The error code. */ + readonly code?: string; + /** The error message. */ + readonly message?: string; + /** The error target. */ + readonly target?: string; + /** The error details. */ + readonly details?: ErrorDetail[]; + /** The error additional info. */ + readonly additionalInfo?: ErrorAdditionalInfo[]; +} + +export function errorDetailDeserializer(item: any): ErrorDetail { + return { + code: item["code"], + message: item["message"], + target: item["target"], + details: !item["details"] ? item["details"] : errorDetailArrayDeserializer(item["details"]), + additionalInfo: !item["additionalInfo"] + ? item["additionalInfo"] + : errorAdditionalInfoArrayDeserializer(item["additionalInfo"]), + }; +} + +export function errorDetailArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return errorDetailDeserializer(item); + }); +} + +export function errorAdditionalInfoArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return errorAdditionalInfoDeserializer(item); + }); +} + +/** The resource management error additional info. */ +export interface ErrorAdditionalInfo { + /** The additional info type. */ + readonly type?: string; + /** The additional info. */ + readonly info?: any; +} + +export function errorAdditionalInfoDeserializer(item: any): ErrorAdditionalInfo { + return { + type: item["type"], + info: item["info"], + }; +} + +/** The type used for updating tags in GalleryImage resources. */ +export interface GalleryImageTagsUpdate { + /** Resource tags. */ + tags?: Record; +} + +export function galleryImageTagsUpdateSerializer(item: GalleryImageTagsUpdate): any { + return { tags: item["tags"] }; +} + +/** The response of a GalleryImage list operation. */ +export interface _GalleryImageListResult { + /** The GalleryImage items on this page */ + value: GalleryImage[]; + /** The link to the next page of items */ + nextLink?: string; +} + +export function _galleryImageListResultDeserializer(item: any): _GalleryImageListResult { + return { + value: galleryImageArrayDeserializer(item["value"]), + nextLink: item["nextLink"], + }; +} + +export function galleryImageArraySerializer(result: Array): any[] { + return result.map((item) => { + return galleryImageSerializer(item); + }); +} + +export function galleryImageArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return galleryImageDeserializer(item); + }); +} + +/** The logical network resource definition. */ +export interface LogicalNetwork extends TrackedResource { + /** The resource-specific properties for this resource. */ + properties?: LogicalNetworkProperties; + /** The extendedLocation of the resource. */ + extendedLocation?: ExtendedLocation; +} + +export function logicalNetworkSerializer(item: LogicalNetwork): any { + return { + tags: item["tags"], + location: item["location"], + properties: !item["properties"] + ? item["properties"] + : logicalNetworkPropertiesSerializer(item["properties"]), + extendedLocation: !item["extendedLocation"] + ? item["extendedLocation"] + : extendedLocationSerializer(item["extendedLocation"]), + }; +} + +export function logicalNetworkDeserializer(item: any): LogicalNetwork { + return { + tags: item["tags"], + location: item["location"], + id: item["id"], + name: item["name"], + type: item["type"], + systemData: !item["systemData"] + ? item["systemData"] + : systemDataDeserializer(item["systemData"]), + properties: !item["properties"] + ? item["properties"] + : logicalNetworkPropertiesDeserializer(item["properties"]), + extendedLocation: !item["extendedLocation"] + ? item["extendedLocation"] + : extendedLocationDeserializer(item["extendedLocation"]), + }; +} + +/** Properties under the logical network resource */ +export interface LogicalNetworkProperties { + /** DhcpOptions contains an array of DNS servers available to VMs deployed in the logical network. Standard DHCP option for a subnet overrides logical network DHCP options. */ + dhcpOptions?: LogicalNetworkPropertiesDhcpOptions; + /** Subnet - list of subnets under the logical network */ + subnets?: Subnet[]; + /** Provisioning state of the logical network. */ + readonly provisioningState?: ProvisioningStateEnum; + /** name of the network switch to be used for VMs */ + vmSwitchName?: string; + /** The observed state of logical networks */ + readonly status?: LogicalNetworkStatus; + /** Type of the Logical Network */ + readonly networkType?: LogicalNetworkTypeEnum; +} + +export function logicalNetworkPropertiesSerializer(item: LogicalNetworkProperties): any { + return { + dhcpOptions: !item["dhcpOptions"] + ? item["dhcpOptions"] + : logicalNetworkPropertiesDhcpOptionsSerializer(item["dhcpOptions"]), + subnets: !item["subnets"] ? item["subnets"] : subnetArraySerializer(item["subnets"]), + vmSwitchName: item["vmSwitchName"], + }; +} + +export function logicalNetworkPropertiesDeserializer(item: any): LogicalNetworkProperties { + return { + dhcpOptions: !item["dhcpOptions"] + ? item["dhcpOptions"] + : logicalNetworkPropertiesDhcpOptionsDeserializer(item["dhcpOptions"]), + subnets: !item["subnets"] ? item["subnets"] : subnetArrayDeserializer(item["subnets"]), + provisioningState: item["provisioningState"], + vmSwitchName: item["vmSwitchName"], + status: !item["status"] ? item["status"] : logicalNetworkStatusDeserializer(item["status"]), + networkType: item["networkType"], + }; +} + +/** DhcpOptions contains an array of DNS servers available to VMs deployed in the logical network. Standard DHCP option for a subnet overrides logical network DHCP options. */ +export interface LogicalNetworkPropertiesDhcpOptions { + /** The list of DNS servers IP addresses. */ + dnsServers?: string[]; +} + +export function logicalNetworkPropertiesDhcpOptionsSerializer( + item: LogicalNetworkPropertiesDhcpOptions, +): any { + return { + dnsServers: !item["dnsServers"] + ? item["dnsServers"] + : item["dnsServers"].map((p: any) => { + return p; + }), + }; +} + +export function logicalNetworkPropertiesDhcpOptionsDeserializer( + item: any, +): LogicalNetworkPropertiesDhcpOptions { + return { + dnsServers: !item["dnsServers"] + ? item["dnsServers"] + : item["dnsServers"].map((p: any) => { + return p; + }), + }; +} + +export function subnetArraySerializer(result: Array): any[] { + return result.map((item) => { + return subnetSerializer(item); + }); +} + +export function subnetArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return subnetDeserializer(item); + }); +} + +/** Properties of the subnet. */ +export interface Subnet { + /** Properties of the subnet. */ + properties?: SubnetProperties; + /** Name - The name of the resource that is unique within a resource group. This name can be used to access the resource. */ + name?: string; +} + +export function subnetSerializer(item: Subnet): any { + return { + properties: !item["properties"] + ? item["properties"] + : subnetPropertiesSerializer(item["properties"]), + name: item["name"], + }; +} + +export function subnetDeserializer(item: any): Subnet { + return { + properties: !item["properties"] + ? item["properties"] + : subnetPropertiesDeserializer(item["properties"]), + name: item["name"], + }; +} + +/** Properties of the subnet. */ +export interface SubnetProperties { + /** The address prefix for the subnet: Cidr for this subnet - IPv4, IPv6. */ + addressPrefix?: string; + /** List of address prefixes for the subnet. */ + addressPrefixes?: string[]; + /** IPAllocationMethod - The IP address allocation method. Possible values include: 'Static', 'Dynamic' */ + ipAllocationMethod?: IpAllocationMethodEnum; + /** IPConfigurationReferences - list of IPConfigurationReferences */ + ipConfigurationReferences?: SubnetIpConfigurationReference[]; + /** NetworkSecurityGroup - Network Security Group attached to the logical network. */ + networkSecurityGroup?: NetworkSecurityGroupArmReference; + /** Route table resource. */ + routeTable?: RouteTable; + /** network associated pool of IP Addresses */ + ipPools?: IPPool[]; + /** Vlan to use for the subnet */ + vlan?: number; +} + +export function subnetPropertiesSerializer(item: SubnetProperties): any { + return { + addressPrefix: item["addressPrefix"], + addressPrefixes: !item["addressPrefixes"] + ? item["addressPrefixes"] + : item["addressPrefixes"].map((p: any) => { + return p; + }), + ipAllocationMethod: item["ipAllocationMethod"], + ipConfigurationReferences: !item["ipConfigurationReferences"] + ? item["ipConfigurationReferences"] + : subnetIpConfigurationReferenceArraySerializer(item["ipConfigurationReferences"]), + networkSecurityGroup: !item["networkSecurityGroup"] + ? item["networkSecurityGroup"] + : networkSecurityGroupArmReferenceSerializer(item["networkSecurityGroup"]), + routeTable: !item["routeTable"] ? item["routeTable"] : routeTableSerializer(item["routeTable"]), + ipPools: !item["ipPools"] ? item["ipPools"] : ipPoolArraySerializer(item["ipPools"]), + vlan: item["vlan"], + }; +} + +export function subnetPropertiesDeserializer(item: any): SubnetProperties { + return { + addressPrefix: item["addressPrefix"], + addressPrefixes: !item["addressPrefixes"] + ? item["addressPrefixes"] + : item["addressPrefixes"].map((p: any) => { + return p; + }), + ipAllocationMethod: item["ipAllocationMethod"], + ipConfigurationReferences: !item["ipConfigurationReferences"] + ? item["ipConfigurationReferences"] + : subnetIpConfigurationReferenceArrayDeserializer(item["ipConfigurationReferences"]), + networkSecurityGroup: !item["networkSecurityGroup"] + ? item["networkSecurityGroup"] + : networkSecurityGroupArmReferenceDeserializer(item["networkSecurityGroup"]), + routeTable: !item["routeTable"] + ? item["routeTable"] + : routeTableDeserializer(item["routeTable"]), + ipPools: !item["ipPools"] ? item["ipPools"] : ipPoolArrayDeserializer(item["ipPools"]), + vlan: item["vlan"], + }; +} + +/** IPAllocationMethod - The IP address allocation method. Possible values include: 'Static', 'Dynamic' */ +export enum KnownIpAllocationMethodEnum { + /** Dynamic IP allocation method */ + Dynamic = "Dynamic", + /** Static IP allocation method */ + Static = "Static", +} + +/** + * IPAllocationMethod - The IP address allocation method. Possible values include: 'Static', 'Dynamic' \ + * {@link KnownIpAllocationMethodEnum} can be used interchangeably with IpAllocationMethodEnum, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Dynamic**: Dynamic IP allocation method \ + * **Static**: Static IP allocation method + */ +export type IpAllocationMethodEnum = string; + +export function subnetIpConfigurationReferenceArraySerializer( + result: Array, +): any[] { + return result.map((item) => { + return subnetIpConfigurationReferenceSerializer(item); + }); +} + +export function subnetIpConfigurationReferenceArrayDeserializer( + result: Array, +): any[] { + return result.map((item) => { + return subnetIpConfigurationReferenceDeserializer(item); + }); +} + +/** The ARM ID for a Network Interface. */ +export interface SubnetIpConfigurationReference { + /** The ARM ID for a Network Interface. */ + id?: string; +} + +export function subnetIpConfigurationReferenceSerializer( + item: SubnetIpConfigurationReference, +): any { + return { ID: item["id"] }; +} + +export function subnetIpConfigurationReferenceDeserializer( + item: any, +): SubnetIpConfigurationReference { + return { + id: item["ID"], + }; +} + +/** The ARM ID for a Network Security Group. */ +export interface NetworkSecurityGroupArmReference { + /** The ARM ID for a Network Security Group. */ + id?: string; +} + +export function networkSecurityGroupArmReferenceSerializer( + item: NetworkSecurityGroupArmReference, +): any { + return { id: item["id"] }; +} + +export function networkSecurityGroupArmReferenceDeserializer( + item: any, +): NetworkSecurityGroupArmReference { + return { + id: item["id"], + }; +} + +/** Route table resource. */ +export interface RouteTable { + /** A unique read-only string that changes whenever the resource is updated. */ + readonly etag?: string; + /** Resource name. */ + readonly name?: string; + /** Resource type. */ + readonly type?: string; + /** Properties of the route table. */ + properties?: RouteTableProperties; +} + +export function routeTableSerializer(item: RouteTable): any { + return { + properties: !item["properties"] + ? item["properties"] + : routeTablePropertiesSerializer(item["properties"]), + }; +} + +export function routeTableDeserializer(item: any): RouteTable { + return { + etag: item["etag"], + name: item["name"], + type: item["type"], + properties: !item["properties"] + ? item["properties"] + : routeTablePropertiesDeserializer(item["properties"]), + }; +} + +/** RouteTablePropertiesFormat - Route Table resource. */ +export interface RouteTableProperties { + /** Collection of routes contained within a route table. */ + routes?: Route[]; +} + +export function routeTablePropertiesSerializer(item: RouteTableProperties): any { + return { + routes: !item["routes"] ? item["routes"] : routeArraySerializer(item["routes"]), + }; +} + +export function routeTablePropertiesDeserializer(item: any): RouteTableProperties { + return { + routes: !item["routes"] ? item["routes"] : routeArrayDeserializer(item["routes"]), + }; +} + +export function routeArraySerializer(result: Array): any[] { + return result.map((item) => { + return routeSerializer(item); + }); +} + +export function routeArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return routeDeserializer(item); + }); +} + +/** Route - Route resource. */ +export interface Route { + /** Properties of the route. */ + properties?: RouteProperties; + /** Name - name of the subnet */ + name?: string; +} + +export function routeSerializer(item: Route): any { + return { + properties: !item["properties"] + ? item["properties"] + : routePropertiesSerializer(item["properties"]), + name: item["name"], + }; +} + +export function routeDeserializer(item: any): Route { + return { + properties: !item["properties"] + ? item["properties"] + : routePropertiesDeserializer(item["properties"]), + name: item["name"], + }; +} + +/** RoutePropertiesFormat - Route resource. */ +export interface RouteProperties { + /** The destination CIDR to which the route applies. */ + addressPrefix?: string; + /** The IP address packets should be forwarded to. Next hop values are only allowed in routes where the next hop type is VirtualAppliance. */ + nextHopIpAddress?: string; +} + +export function routePropertiesSerializer(item: RouteProperties): any { + return { + addressPrefix: item["addressPrefix"], + nextHopIpAddress: item["nextHopIpAddress"], + }; +} + +export function routePropertiesDeserializer(item: any): RouteProperties { + return { + addressPrefix: item["addressPrefix"], + nextHopIpAddress: item["nextHopIpAddress"], + }; +} + +export function ipPoolArraySerializer(result: Array): any[] { + return result.map((item) => { + return ipPoolSerializer(item); + }); +} + +export function ipPoolArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return ipPoolDeserializer(item); + }); +} + +/** Describes IPPool */ +export interface IPPool { + /** Name of the IP-Pool */ + name?: string; + /** Type of the IP Pool [vm, vippool] */ + ipPoolType?: IPPoolTypeEnum; + /** Start of the IP address pool */ + start?: string; + /** End of the IP address pool */ + end?: string; + /** IPPool info */ + info?: IPPoolInfo; +} + +export function ipPoolSerializer(item: IPPool): any { + return { + name: item["name"], + ipPoolType: item["ipPoolType"], + start: item["start"], + end: item["end"], + info: !item["info"] ? item["info"] : ipPoolInfoSerializer(item["info"]), + }; +} + +export function ipPoolDeserializer(item: any): IPPool { + return { + name: item["name"], + ipPoolType: item["ipPoolType"], + start: item["start"], + end: item["end"], + info: !item["info"] ? item["info"] : ipPoolInfoDeserializer(item["info"]), + }; +} + +/** Type of the IP Pool [vm, vippool] */ +export enum KnownIPPoolTypeEnum { + /** Virtual Machine IP Pool */ + Vm = "vm", + /** VIP Pool */ + Vippool = "vippool", +} + +/** + * Type of the IP Pool [vm, vippool] \ + * {@link KnownIPPoolTypeEnum} can be used interchangeably with IPPoolTypeEnum, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **vm**: Virtual Machine IP Pool \ + * **vippool**: VIP Pool + */ +export type IPPoolTypeEnum = string; + +/** IP Pool info */ +export interface IPPoolInfo { + /** Number of IP addresses allocated from the IP Pool */ + readonly used?: string; + /** Number of IP addresses available in the IP Pool */ + readonly available?: string; +} + +export function ipPoolInfoSerializer(item: IPPoolInfo): any { + return item; +} + +export function ipPoolInfoDeserializer(item: any): IPPoolInfo { + return { + used: item["used"], + available: item["available"], + }; +} + +/** The observed state of logical networks */ +export interface LogicalNetworkStatus { + /** LogicalNetwork provisioning error code */ + errorCode?: string; + /** Descriptive error message */ + errorMessage?: string; + /** Logical network provisioning status */ + provisioningStatus?: LogicalNetworkStatusProvisioningStatus; +} + +export function logicalNetworkStatusDeserializer(item: any): LogicalNetworkStatus { + return { + errorCode: item["errorCode"], + errorMessage: item["errorMessage"], + provisioningStatus: !item["provisioningStatus"] + ? item["provisioningStatus"] + : logicalNetworkStatusProvisioningStatusDeserializer(item["provisioningStatus"]), + }; +} + +/** Describes the status of the provisioning. */ +export interface LogicalNetworkStatusProvisioningStatus { + /** The ID of the operation performed on the logical network */ + operationId?: string; + /** The status of the operation performed on the logical network [Succeeded, Failed, InProgress] */ + status?: Status; +} + +export function logicalNetworkStatusProvisioningStatusDeserializer( + item: any, +): LogicalNetworkStatusProvisioningStatus { + return { + operationId: item["operationId"], + status: item["status"], + }; +} + +/** Type of Logical Network */ +export enum KnownLogicalNetworkTypeEnum { + /** Logical Network of type Workload */ + Workload = "Workload", + /** Logical Network of type Infrastructure */ + Infrastructure = "Infrastructure", +} + +/** + * Type of Logical Network \ + * {@link KnownLogicalNetworkTypeEnum} can be used interchangeably with LogicalNetworkTypeEnum, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Workload**: Logical Network of type Workload \ + * **Infrastructure**: Logical Network of type Infrastructure + */ +export type LogicalNetworkTypeEnum = string; + +/** The logical network resource patch definition. */ +export interface LogicalNetworksUpdateRequest { + /** Resource tags */ + tags?: Record; +} + +export function logicalNetworksUpdateRequestSerializer(item: LogicalNetworksUpdateRequest): any { + return { tags: item["tags"] }; +} + +/** The response of a LogicalNetwork list operation. */ +export interface _LogicalNetworkListResult { + /** The LogicalNetwork items on this page */ + value: LogicalNetwork[]; + /** The link to the next page of items */ + nextLink?: string; +} + +export function _logicalNetworkListResultDeserializer(item: any): _LogicalNetworkListResult { + return { + value: logicalNetworkArrayDeserializer(item["value"]), + nextLink: item["nextLink"], + }; +} + +export function logicalNetworkArraySerializer(result: Array): any[] { + return result.map((item) => { + return logicalNetworkSerializer(item); + }); +} + +export function logicalNetworkArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return logicalNetworkDeserializer(item); + }); +} + +/** The marketplace gallery image resource definition. */ +export interface MarketplaceGalleryImage extends TrackedResource { + /** The resource-specific properties for this resource. */ + properties?: MarketplaceGalleryImageProperties; + /** The extendedLocation of the resource. */ + extendedLocation?: ExtendedLocation; +} + +export function marketplaceGalleryImageSerializer(item: MarketplaceGalleryImage): any { + return { + tags: item["tags"], + location: item["location"], + properties: !item["properties"] + ? item["properties"] + : marketplaceGalleryImagePropertiesSerializer(item["properties"]), + extendedLocation: !item["extendedLocation"] + ? item["extendedLocation"] + : extendedLocationSerializer(item["extendedLocation"]), + }; +} + +export function marketplaceGalleryImageDeserializer(item: any): MarketplaceGalleryImage { + return { + tags: item["tags"], + location: item["location"], + id: item["id"], + name: item["name"], + type: item["type"], + systemData: !item["systemData"] + ? item["systemData"] + : systemDataDeserializer(item["systemData"]), + properties: !item["properties"] + ? item["properties"] + : marketplaceGalleryImagePropertiesDeserializer(item["properties"]), + extendedLocation: !item["extendedLocation"] + ? item["extendedLocation"] + : extendedLocationDeserializer(item["extendedLocation"]), + }; +} + +/** Properties under the marketplace gallery image resource */ +export interface MarketplaceGalleryImageProperties { + /** Storage ContainerID of the storage container to be used for marketplace gallery image */ + containerId?: string; + /** Operating system type that the gallery image uses [Windows, Linux] */ + osType: OperatingSystemTypes; + /** Datasource for the gallery image when provisioning with cloud-init [NoCloud, Azure] */ + cloudInitDataSource?: CloudInitDataSource; + /** The hypervisor generation of the Virtual Machine [V1, V2] */ + hyperVGeneration?: HyperVGeneration; + /** This is the gallery image definition identifier. */ + identifier?: GalleryImageIdentifier; + /** Specifies information about the gallery image version that you want to create or update. */ + version?: GalleryImageVersion; + /** Provisioning state of the marketplace gallery image. */ + readonly provisioningState?: ProvisioningStateEnum; + /** The observed state of marketplace gallery images */ + readonly status?: MarketplaceGalleryImageStatus; +} + +export function marketplaceGalleryImagePropertiesSerializer( + item: MarketplaceGalleryImageProperties, +): any { + return { + containerId: item["containerId"], + osType: item["osType"], + cloudInitDataSource: item["cloudInitDataSource"], + hyperVGeneration: item["hyperVGeneration"], + identifier: !item["identifier"] + ? item["identifier"] + : galleryImageIdentifierSerializer(item["identifier"]), + version: !item["version"] ? item["version"] : galleryImageVersionSerializer(item["version"]), + }; +} + +export function marketplaceGalleryImagePropertiesDeserializer( + item: any, +): MarketplaceGalleryImageProperties { + return { + containerId: item["containerId"], + osType: item["osType"], + cloudInitDataSource: item["cloudInitDataSource"], + hyperVGeneration: item["hyperVGeneration"], + identifier: !item["identifier"] + ? item["identifier"] + : galleryImageIdentifierDeserializer(item["identifier"]), + version: !item["version"] ? item["version"] : galleryImageVersionDeserializer(item["version"]), + provisioningState: item["provisioningState"], + status: !item["status"] + ? item["status"] + : marketplaceGalleryImageStatusDeserializer(item["status"]), + }; +} + +/** The observed state of marketplace gallery images */ +export interface MarketplaceGalleryImageStatus { + /** MarketplaceGalleryImage provisioning error code */ + errorCode?: string; + /** Descriptive error message */ + errorMessage?: string; + /** Provisioning status of marketplace gallery image */ + provisioningStatus?: MarketplaceGalleryImageStatusProvisioningStatus; + /** The download status of the gallery image */ + downloadStatus?: MarketplaceGalleryImageStatusDownloadStatus; + /** The progress of the operation in percentage */ + progressPercentage?: number; +} + +export function marketplaceGalleryImageStatusDeserializer( + item: any, +): MarketplaceGalleryImageStatus { + return { + errorCode: item["errorCode"], + errorMessage: item["errorMessage"], + provisioningStatus: !item["provisioningStatus"] + ? item["provisioningStatus"] + : marketplaceGalleryImageStatusProvisioningStatusDeserializer(item["provisioningStatus"]), + downloadStatus: !item["downloadStatus"] + ? item["downloadStatus"] + : marketplaceGalleryImageStatusDownloadStatusDeserializer(item["downloadStatus"]), + progressPercentage: item["progressPercentage"], + }; +} + +/** Marketplace GalleryImage provisioning status */ +export interface MarketplaceGalleryImageStatusProvisioningStatus { + /** The ID of the operation performed on the gallery image */ + operationId?: string; + /** The status of the operation performed on the gallery image [Succeeded, Failed, InProgress] */ + status?: Status; +} + +export function marketplaceGalleryImageStatusProvisioningStatusDeserializer( + item: any, +): MarketplaceGalleryImageStatusProvisioningStatus { + return { + operationId: item["operationId"], + status: item["status"], + }; +} + +/** The download status of the gallery image */ +export interface MarketplaceGalleryImageStatusDownloadStatus { + /** The downloaded sized of the image in MB */ + downloadSizeInMB?: number; +} + +export function marketplaceGalleryImageStatusDownloadStatusDeserializer( + item: any, +): MarketplaceGalleryImageStatusDownloadStatus { + return { + downloadSizeInMB: item["downloadSizeInMB"], + }; +} + +/** The type used for updating tags in MarketplaceGalleryImage resources. */ +export interface MarketplaceGalleryImageTagsUpdate { + /** Resource tags. */ + tags?: Record; +} + +export function marketplaceGalleryImageTagsUpdateSerializer( + item: MarketplaceGalleryImageTagsUpdate, +): any { + return { tags: item["tags"] }; +} + +/** The response of a MarketplaceGalleryImage list operation. */ +export interface _MarketplaceGalleryImageListResult { + /** The MarketplaceGalleryImage items on this page */ + value: MarketplaceGalleryImage[]; + /** The link to the next page of items */ + nextLink?: string; +} + +export function _marketplaceGalleryImageListResultDeserializer( + item: any, +): _MarketplaceGalleryImageListResult { + return { + value: marketplaceGalleryImageArrayDeserializer(item["value"]), + nextLink: item["nextLink"], + }; +} + +export function marketplaceGalleryImageArraySerializer( + result: Array, +): any[] { + return result.map((item) => { + return marketplaceGalleryImageSerializer(item); + }); +} + +export function marketplaceGalleryImageArrayDeserializer( + result: Array, +): any[] { + return result.map((item) => { + return marketplaceGalleryImageDeserializer(item); + }); +} + +/** The network interface resource definition. */ +export interface NetworkInterface extends TrackedResource { + /** The resource-specific properties for this resource. */ + properties?: NetworkInterfaceProperties; + /** The extendedLocation of the resource. */ + extendedLocation?: ExtendedLocation; +} + +export function networkInterfaceSerializer(item: NetworkInterface): any { + return { + tags: item["tags"], + location: item["location"], + properties: !item["properties"] + ? item["properties"] + : networkInterfacePropertiesSerializer(item["properties"]), + extendedLocation: !item["extendedLocation"] + ? item["extendedLocation"] + : extendedLocationSerializer(item["extendedLocation"]), + }; +} + +export function networkInterfaceDeserializer(item: any): NetworkInterface { + return { + tags: item["tags"], + location: item["location"], + id: item["id"], + name: item["name"], + type: item["type"], + systemData: !item["systemData"] + ? item["systemData"] + : systemDataDeserializer(item["systemData"]), + properties: !item["properties"] + ? item["properties"] + : networkInterfacePropertiesDeserializer(item["properties"]), + extendedLocation: !item["extendedLocation"] + ? item["extendedLocation"] + : extendedLocationDeserializer(item["extendedLocation"]), + }; +} + +/** Properties under the network interface resource */ +export interface NetworkInterfaceProperties { + /** IPConfigurations - A list of IPConfigurations of the network interface. */ + ipConfigurations?: IPConfiguration[]; + /** MacAddress - The MAC address of the network interface. */ + macAddress?: string; + /** DNS Settings for the interface */ + dnsSettings?: InterfaceDNSSettings; + /** Boolean indicating whether this is a existing local network interface or if one should be created. */ + createFromLocal?: boolean; + /** Provisioning state of the network interface. */ + readonly provisioningState?: ProvisioningStateEnum; + /** The observed state of network interfaces */ + readonly status?: NetworkInterfaceStatus; + /** NetworkSecurityGroup - Network Security Group attached to the network interface. */ + networkSecurityGroup?: NetworkSecurityGroupArmReference; +} + +export function networkInterfacePropertiesSerializer(item: NetworkInterfaceProperties): any { + return { + ipConfigurations: !item["ipConfigurations"] + ? item["ipConfigurations"] + : ipConfigurationArraySerializer(item["ipConfigurations"]), + macAddress: item["macAddress"], + dnsSettings: !item["dnsSettings"] + ? item["dnsSettings"] + : interfaceDNSSettingsSerializer(item["dnsSettings"]), + createFromLocal: item["createFromLocal"], + networkSecurityGroup: !item["networkSecurityGroup"] + ? item["networkSecurityGroup"] + : networkSecurityGroupArmReferenceSerializer(item["networkSecurityGroup"]), + }; +} + +export function networkInterfacePropertiesDeserializer(item: any): NetworkInterfaceProperties { + return { + ipConfigurations: !item["ipConfigurations"] + ? item["ipConfigurations"] + : ipConfigurationArrayDeserializer(item["ipConfigurations"]), + macAddress: item["macAddress"], + dnsSettings: !item["dnsSettings"] + ? item["dnsSettings"] + : interfaceDNSSettingsDeserializer(item["dnsSettings"]), + createFromLocal: item["createFromLocal"], + provisioningState: item["provisioningState"], + status: !item["status"] ? item["status"] : networkInterfaceStatusDeserializer(item["status"]), + networkSecurityGroup: !item["networkSecurityGroup"] + ? item["networkSecurityGroup"] + : networkSecurityGroupArmReferenceDeserializer(item["networkSecurityGroup"]), + }; +} + +export function ipConfigurationArraySerializer(result: Array): any[] { + return result.map((item) => { + return ipConfigurationSerializer(item); + }); +} + +export function ipConfigurationArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return ipConfigurationDeserializer(item); + }); +} + +/** InterfaceIPConfiguration IPConfiguration in a network interface. */ +export interface IPConfiguration { + /** Name - The name of the resource that is unique within a resource group. This name can be used to access the resource. */ + name?: string; + /** InterfaceIPConfigurationPropertiesFormat properties of IP configuration. */ + properties?: IPConfigurationProperties; +} + +export function ipConfigurationSerializer(item: IPConfiguration): any { + return { + name: item["name"], + properties: !item["properties"] + ? item["properties"] + : ipConfigurationPropertiesSerializer(item["properties"]), + }; +} + +export function ipConfigurationDeserializer(item: any): IPConfiguration { + return { + name: item["name"], + properties: !item["properties"] + ? item["properties"] + : ipConfigurationPropertiesDeserializer(item["properties"]), + }; +} + +/** InterfaceIPConfigurationPropertiesFormat properties of IP configuration. */ +export interface IPConfigurationProperties { + /** Gateway for network interface */ + readonly gateway?: string; + /** prefixLength for network interface */ + readonly prefixLength?: string; + /** PrivateIPAddress - Private IP address of the IP configuration. */ + privateIPAddress?: string; + /** Subnet - Name of Subnet bound to the IP configuration. */ + subnet?: LogicalNetworkArmReference; +} + +export function ipConfigurationPropertiesSerializer(item: IPConfigurationProperties): any { + return { + privateIPAddress: item["privateIPAddress"], + subnet: !item["subnet"] ? item["subnet"] : logicalNetworkArmReferenceSerializer(item["subnet"]), + }; +} + +export function ipConfigurationPropertiesDeserializer(item: any): IPConfigurationProperties { + return { + gateway: item["gateway"], + prefixLength: item["prefixLength"], + privateIPAddress: item["privateIPAddress"], + subnet: !item["subnet"] + ? item["subnet"] + : logicalNetworkArmReferenceDeserializer(item["subnet"]), + }; +} + +/** The ARM ID for a Logical Network. */ +export interface LogicalNetworkArmReference { + /** The ARM ID for a Logical Network. */ + id?: string; +} + +export function logicalNetworkArmReferenceSerializer(item: LogicalNetworkArmReference): any { + return { id: item["id"] }; +} + +export function logicalNetworkArmReferenceDeserializer(item: any): LogicalNetworkArmReference { + return { + id: item["id"], + }; +} + +/** DNS Settings of the interface */ +export interface InterfaceDNSSettings { + /** List of DNS server IP Addresses for the interface */ + dnsServers?: string[]; +} + +export function interfaceDNSSettingsSerializer(item: InterfaceDNSSettings): any { + return { + dnsServers: !item["dnsServers"] + ? item["dnsServers"] + : item["dnsServers"].map((p: any) => { + return p; + }), + }; +} + +export function interfaceDNSSettingsDeserializer(item: any): InterfaceDNSSettings { + return { + dnsServers: !item["dnsServers"] + ? item["dnsServers"] + : item["dnsServers"].map((p: any) => { + return p; + }), + }; +} + +/** The observed state of network interfaces */ +export interface NetworkInterfaceStatus { + /** NetworkInterface provisioning error code */ + errorCode?: string; + /** Descriptive error message */ + errorMessage?: string; + /** Network interface provisioning status */ + provisioningStatus?: NetworkInterfaceStatusProvisioningStatus; +} + +export function networkInterfaceStatusDeserializer(item: any): NetworkInterfaceStatus { + return { + errorCode: item["errorCode"], + errorMessage: item["errorMessage"], + provisioningStatus: !item["provisioningStatus"] + ? item["provisioningStatus"] + : networkInterfaceStatusProvisioningStatusDeserializer(item["provisioningStatus"]), + }; +} + +/** Network interface provisioning status */ +export interface NetworkInterfaceStatusProvisioningStatus { + /** The ID of the operation performed on the network interface */ + operationId?: string; + /** The status of the operation performed on the network interface [Succeeded, Failed, InProgress] */ + status?: Status; +} + +export function networkInterfaceStatusProvisioningStatusDeserializer( + item: any, +): NetworkInterfaceStatusProvisioningStatus { + return { + operationId: item["operationId"], + status: item["status"], + }; +} + +/** The network interface resource patch definition. */ +export interface NetworkInterfacesUpdateRequest { + /** Resource tags */ + tags?: Record; + /** Defines the resource properties for the update. */ + properties?: NetworkInterfacesUpdateProperties; +} + +export function networkInterfacesUpdateRequestSerializer( + item: NetworkInterfacesUpdateRequest, +): any { + return { + tags: item["tags"], + properties: !item["properties"] + ? item["properties"] + : networkInterfacesUpdatePropertiesSerializer(item["properties"]), + }; +} + +/** Defines the resource properties for the update. */ +export interface NetworkInterfacesUpdateProperties { + /** NetworkSecurityGroup - Network Security Group attached to the network interface. */ + networkSecurityGroup?: NetworkSecurityGroupArmReference; + /** DNS Settings for the interface */ + dnsSettings?: InterfaceDNSSettings; +} + +export function networkInterfacesUpdatePropertiesSerializer( + item: NetworkInterfacesUpdateProperties, +): any { + return { + networkSecurityGroup: !item["networkSecurityGroup"] + ? item["networkSecurityGroup"] + : networkSecurityGroupArmReferenceSerializer(item["networkSecurityGroup"]), + dnsSettings: !item["dnsSettings"] + ? item["dnsSettings"] + : interfaceDNSSettingsSerializer(item["dnsSettings"]), + }; +} + +/** The response of a NetworkInterface list operation. */ +export interface _NetworkInterfaceListResult { + /** The NetworkInterface items on this page */ + value: NetworkInterface[]; + /** The link to the next page of items */ + nextLink?: string; +} + +export function _networkInterfaceListResultDeserializer(item: any): _NetworkInterfaceListResult { + return { + value: networkInterfaceArrayDeserializer(item["value"]), + nextLink: item["nextLink"], + }; +} + +export function networkInterfaceArraySerializer(result: Array): any[] { + return result.map((item) => { + return networkInterfaceSerializer(item); + }); +} + +export function networkInterfaceArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return networkInterfaceDeserializer(item); + }); +} + +/** NetworkSecurityGroup resource. */ +export interface NetworkSecurityGroup extends TrackedResource { + /** The resource-specific properties for this resource. */ + properties?: NetworkSecurityGroupProperties; + /** The extendedLocation of the resource. */ + extendedLocation?: ExtendedLocation; + /** If eTag is provided in the response body, it may also be provided as a header per the normal etag convention. Entity tags are used for comparing two or more entities from the same requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match (section 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) header fields. */ + readonly eTag?: string; +} + +export function networkSecurityGroupSerializer(item: NetworkSecurityGroup): any { + return { + tags: item["tags"], + location: item["location"], + properties: !item["properties"] + ? item["properties"] + : networkSecurityGroupPropertiesSerializer(item["properties"]), + extendedLocation: !item["extendedLocation"] + ? item["extendedLocation"] + : extendedLocationSerializer(item["extendedLocation"]), + }; +} + +export function networkSecurityGroupDeserializer(item: any): NetworkSecurityGroup { + return { + tags: item["tags"], + location: item["location"], + id: item["id"], + name: item["name"], + type: item["type"], + systemData: !item["systemData"] + ? item["systemData"] + : systemDataDeserializer(item["systemData"]), + properties: !item["properties"] + ? item["properties"] + : networkSecurityGroupPropertiesDeserializer(item["properties"]), + extendedLocation: !item["extendedLocation"] + ? item["extendedLocation"] + : extendedLocationDeserializer(item["extendedLocation"]), + eTag: item["eTag"], + }; +} + +/** Network Security Group resource. */ +export interface NetworkSecurityGroupProperties { + /** A collection of references to network interfaces that are currently using this NSG. */ + readonly networkInterfaces?: NetworkInterfaceArmReference[]; + /** A collection of references to logical networks that are currently using this NSG */ + readonly subnets?: LogicalNetworkArmReference[]; + /** The provisioning state of the network security group resource. */ + readonly provisioningState?: ProvisioningStateEnum; + /** The observed state of Network Security Group */ + readonly status?: NetworkSecurityGroupStatus; +} + +export function networkSecurityGroupPropertiesSerializer( + item: NetworkSecurityGroupProperties, +): any { + return item; +} + +export function networkSecurityGroupPropertiesDeserializer( + item: any, +): NetworkSecurityGroupProperties { + return { + networkInterfaces: !item["networkInterfaces"] + ? item["networkInterfaces"] + : networkInterfaceArmReferenceArrayDeserializer(item["networkInterfaces"]), + subnets: !item["subnets"] + ? item["subnets"] + : logicalNetworkArmReferenceArrayDeserializer(item["subnets"]), + provisioningState: item["provisioningState"], + status: !item["status"] + ? item["status"] + : networkSecurityGroupStatusDeserializer(item["status"]), + }; +} + +export function networkInterfaceArmReferenceArraySerializer( + result: Array, +): any[] { + return result.map((item) => { + return networkInterfaceArmReferenceSerializer(item); + }); +} + +export function networkInterfaceArmReferenceArrayDeserializer( + result: Array, +): any[] { + return result.map((item) => { + return networkInterfaceArmReferenceDeserializer(item); + }); +} + +/** The ARM ID for a Network Interface. */ +export interface NetworkInterfaceArmReference { + /** The ARM ID for a Network Interface. */ + id?: string; +} + +export function networkInterfaceArmReferenceSerializer(item: NetworkInterfaceArmReference): any { + return { id: item["id"] }; +} + +export function networkInterfaceArmReferenceDeserializer(item: any): NetworkInterfaceArmReference { + return { + id: item["id"], + }; +} + +export function logicalNetworkArmReferenceArraySerializer( + result: Array, +): any[] { + return result.map((item) => { + return logicalNetworkArmReferenceSerializer(item); + }); +} + +export function logicalNetworkArmReferenceArrayDeserializer( + result: Array, +): any[] { + return result.map((item) => { + return logicalNetworkArmReferenceDeserializer(item); + }); +} + +/** The observed state of network security group */ +export interface NetworkSecurityGroupStatus { + /** NetworkSecurityGroup provisioning error code */ + errorCode?: string; + /** Descriptive error message */ + errorMessage?: string; + /** network security group provisioning status */ + provisioningStatus?: NetworkSecurityGroupStatusProvisioningStatus; +} + +export function networkSecurityGroupStatusDeserializer(item: any): NetworkSecurityGroupStatus { + return { + errorCode: item["errorCode"], + errorMessage: item["errorMessage"], + provisioningStatus: !item["provisioningStatus"] + ? item["provisioningStatus"] + : networkSecurityGroupStatusProvisioningStatusDeserializer(item["provisioningStatus"]), + }; +} + +/** network security group provisioning status */ +export interface NetworkSecurityGroupStatusProvisioningStatus { + /** The ID of the operation performed on the network security group */ + operationId?: string; + /** The status of the operation performed on the network security group [Succeeded, Failed, InProgress] */ + status?: Status; +} + +export function networkSecurityGroupStatusProvisioningStatusDeserializer( + item: any, +): NetworkSecurityGroupStatusProvisioningStatus { + return { + operationId: item["operationId"], + status: item["status"], + }; +} + +/** The type used for updating tags in NetworkSecurityGroup resources. */ +export interface NetworkSecurityGroupTagsUpdate { + /** Resource tags. */ + tags?: Record; +} + +export function networkSecurityGroupTagsUpdateSerializer( + item: NetworkSecurityGroupTagsUpdate, +): any { + return { tags: item["tags"] }; +} + +/** The response of a NetworkSecurityGroup list operation. */ +export interface _NetworkSecurityGroupListResult { + /** The NetworkSecurityGroup items on this page */ + value: NetworkSecurityGroup[]; + /** The link to the next page of items */ + nextLink?: string; +} + +export function _networkSecurityGroupListResultDeserializer( + item: any, +): _NetworkSecurityGroupListResult { + return { + value: networkSecurityGroupArrayDeserializer(item["value"]), + nextLink: item["nextLink"], + }; +} + +export function networkSecurityGroupArraySerializer(result: Array): any[] { + return result.map((item) => { + return networkSecurityGroupSerializer(item); + }); +} + +export function networkSecurityGroupArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return networkSecurityGroupDeserializer(item); + }); +} + +/** Security Rule resource. */ +export interface SecurityRule extends ProxyResource { + /** The resource-specific properties for this resource. */ + properties?: SecurityRuleProperties; + /** The extendedLocation of the resource. */ + extendedLocation?: ExtendedLocation; +} + +export function securityRuleSerializer(item: SecurityRule): any { + return { + properties: !item["properties"] + ? item["properties"] + : securityRulePropertiesSerializer(item["properties"]), + extendedLocation: !item["extendedLocation"] + ? item["extendedLocation"] + : extendedLocationSerializer(item["extendedLocation"]), + }; +} + +export function securityRuleDeserializer(item: any): SecurityRule { + return { + id: item["id"], + name: item["name"], + type: item["type"], + systemData: !item["systemData"] + ? item["systemData"] + : systemDataDeserializer(item["systemData"]), + properties: !item["properties"] + ? item["properties"] + : securityRulePropertiesDeserializer(item["properties"]), + extendedLocation: !item["extendedLocation"] + ? item["extendedLocation"] + : extendedLocationDeserializer(item["extendedLocation"]), + }; +} + +/** Security rule resource. */ +export interface SecurityRuleProperties { + /** A description for this rule. Restricted to 140 chars. */ + description?: string; + /** Network protocol this rule applies to. */ + protocol: SecurityRuleProtocol; + /** The CIDR or source IP ranges. */ + sourceAddressPrefixes?: string[]; + /** The destination address prefixes. CIDR or destination IP ranges. */ + destinationAddressPrefixes?: string[]; + /** The source port ranges. Integer or range between 0 and 65535. Asterisk '*' can also be used to match all ports. */ + sourcePortRanges?: string[]; + /** The destination port ranges. Integer or range between 0 and 65535. Asterisk '*' can also be used to match all ports. */ + destinationPortRanges?: string[]; + /** The network traffic is allowed or denied. */ + access: SecurityRuleAccess; + /** The priority of the rule. The value can be between 100 and 4096. The priority number must be unique for each rule in the collection. The lower the priority number, the higher the priority of the rule. */ + priority: number; + /** The direction of the rule. The direction specifies if rule will be evaluated on incoming or outgoing traffic. */ + direction: SecurityRuleDirection; + /** Provisioning state of the SR */ + readonly provisioningState?: ProvisioningStateEnum; +} + +export function securityRulePropertiesSerializer(item: SecurityRuleProperties): any { + return { + description: item["description"], + protocol: item["protocol"], + sourceAddressPrefixes: !item["sourceAddressPrefixes"] + ? item["sourceAddressPrefixes"] + : item["sourceAddressPrefixes"].map((p: any) => { + return p; + }), + destinationAddressPrefixes: !item["destinationAddressPrefixes"] + ? item["destinationAddressPrefixes"] + : item["destinationAddressPrefixes"].map((p: any) => { + return p; + }), + sourcePortRanges: !item["sourcePortRanges"] + ? item["sourcePortRanges"] + : item["sourcePortRanges"].map((p: any) => { + return p; + }), + destinationPortRanges: !item["destinationPortRanges"] + ? item["destinationPortRanges"] + : item["destinationPortRanges"].map((p: any) => { + return p; + }), + access: item["access"], + priority: item["priority"], + direction: item["direction"], + }; +} + +export function securityRulePropertiesDeserializer(item: any): SecurityRuleProperties { + return { + description: item["description"], + protocol: item["protocol"], + sourceAddressPrefixes: !item["sourceAddressPrefixes"] + ? item["sourceAddressPrefixes"] + : item["sourceAddressPrefixes"].map((p: any) => { + return p; + }), + destinationAddressPrefixes: !item["destinationAddressPrefixes"] + ? item["destinationAddressPrefixes"] + : item["destinationAddressPrefixes"].map((p: any) => { + return p; + }), + sourcePortRanges: !item["sourcePortRanges"] + ? item["sourcePortRanges"] + : item["sourcePortRanges"].map((p: any) => { + return p; + }), + destinationPortRanges: !item["destinationPortRanges"] + ? item["destinationPortRanges"] + : item["destinationPortRanges"].map((p: any) => { + return p; + }), + access: item["access"], + priority: item["priority"], + direction: item["direction"], + provisioningState: item["provisioningState"], + }; +} + +/** Network protocol this rule applies to. */ +export enum KnownSecurityRuleProtocol { + /** Transmission Control Protocol */ + Tcp = "Tcp", + /** User Datagram Protocol */ + Udp = "Udp", + /** Internet Control Message Protocol */ + Icmp = "Icmp", + /** Wildcard rule for all protocols */ + Asterisk = "*", +} + +/** + * Network protocol this rule applies to. \ + * {@link KnownSecurityRuleProtocol} can be used interchangeably with SecurityRuleProtocol, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Tcp**: Transmission Control Protocol \ + * **Udp**: User Datagram Protocol \ + * **Icmp**: Internet Control Message Protocol \ + * *****: Wildcard rule for all protocols + */ +export type SecurityRuleProtocol = string; + +/** Whether network traffic is allowed or denied. */ +export enum KnownSecurityRuleAccess { + /** Network traffic is allowed */ + Allow = "Allow", + /** Network traffic is denied */ + Deny = "Deny", +} + +/** + * Whether network traffic is allowed or denied. \ + * {@link KnownSecurityRuleAccess} can be used interchangeably with SecurityRuleAccess, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Allow**: Network traffic is allowed \ + * **Deny**: Network traffic is denied + */ +export type SecurityRuleAccess = string; + +/** The direction of the rule. The direction specifies if rule will be evaluated on incoming or outgoing traffic. */ +export enum KnownSecurityRuleDirection { + /** Rule is evaluated on incoming traffic */ + Inbound = "Inbound", + /** Rule is evaluated on outgoing traffic */ + Outbound = "Outbound", +} + +/** + * The direction of the rule. The direction specifies if rule will be evaluated on incoming or outgoing traffic. \ + * {@link KnownSecurityRuleDirection} can be used interchangeably with SecurityRuleDirection, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Inbound**: Rule is evaluated on incoming traffic \ + * **Outbound**: Rule is evaluated on outgoing traffic + */ +export type SecurityRuleDirection = string; + +/** The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location */ +export interface ProxyResource extends Resource {} + +export function proxyResourceSerializer(item: ProxyResource): any { + return item; +} + +export function proxyResourceDeserializer(item: any): ProxyResource { + return { + id: item["id"], + name: item["name"], + type: item["type"], + systemData: !item["systemData"] + ? item["systemData"] + : systemDataDeserializer(item["systemData"]), + }; +} + +/** The response of a SecurityRule list operation. */ +export interface _SecurityRuleListResult { + /** The SecurityRule items on this page */ + value: SecurityRule[]; + /** The link to the next page of items */ + nextLink?: string; +} + +export function _securityRuleListResultDeserializer(item: any): _SecurityRuleListResult { + return { + value: securityRuleArrayDeserializer(item["value"]), + nextLink: item["nextLink"], + }; +} + +export function securityRuleArraySerializer(result: Array): any[] { + return result.map((item) => { + return securityRuleSerializer(item); + }); +} + +export function securityRuleArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return securityRuleDeserializer(item); + }); +} + +/** The storage container resource definition. */ +export interface StorageContainer extends TrackedResource { + /** The resource-specific properties for this resource. */ + properties?: StorageContainerProperties; + /** The extendedLocation of the resource. */ + extendedLocation?: ExtendedLocation; +} + +export function storageContainerSerializer(item: StorageContainer): any { + return { + tags: item["tags"], + location: item["location"], + properties: !item["properties"] + ? item["properties"] + : storageContainerPropertiesSerializer(item["properties"]), + extendedLocation: !item["extendedLocation"] + ? item["extendedLocation"] + : extendedLocationSerializer(item["extendedLocation"]), + }; +} + +export function storageContainerDeserializer(item: any): StorageContainer { + return { + tags: item["tags"], + location: item["location"], + id: item["id"], + name: item["name"], + type: item["type"], + systemData: !item["systemData"] + ? item["systemData"] + : systemDataDeserializer(item["systemData"]), + properties: !item["properties"] + ? item["properties"] + : storageContainerPropertiesDeserializer(item["properties"]), + extendedLocation: !item["extendedLocation"] + ? item["extendedLocation"] + : extendedLocationDeserializer(item["extendedLocation"]), + }; +} + +/** Properties under the storage container resource */ +export interface StorageContainerProperties { + /** Path of the storage container on the disk */ + path: string; + /** Provisioning state of the storage container. */ + readonly provisioningState?: ProvisioningStateEnum; + /** The observed state of storage containers */ + readonly status?: StorageContainerStatus; +} + +export function storageContainerPropertiesSerializer(item: StorageContainerProperties): any { + return { path: item["path"] }; +} + +export function storageContainerPropertiesDeserializer(item: any): StorageContainerProperties { + return { + path: item["path"], + provisioningState: item["provisioningState"], + status: !item["status"] ? item["status"] : storageContainerStatusDeserializer(item["status"]), + }; +} + +/** The observed state of storage containers */ +export interface StorageContainerStatus { + /** StorageContainer provisioning error code */ + errorCode?: string; + /** Descriptive error message */ + errorMessage?: string; + /** Amount of space available on the disk in MB */ + availableSizeMB?: number; + /** Total size of the disk in MB */ + containerSizeMB?: number; + /** Storage container's provisioning status */ + provisioningStatus?: StorageContainerStatusProvisioningStatus; +} + +export function storageContainerStatusDeserializer(item: any): StorageContainerStatus { + return { + errorCode: item["errorCode"], + errorMessage: item["errorMessage"], + availableSizeMB: item["availableSizeMB"], + containerSizeMB: item["containerSizeMB"], + provisioningStatus: !item["provisioningStatus"] + ? item["provisioningStatus"] + : storageContainerStatusProvisioningStatusDeserializer(item["provisioningStatus"]), + }; +} + +/** Storage container provisioning status */ +export interface StorageContainerStatusProvisioningStatus { + /** The ID of the operation performed on the storage container */ + operationId?: string; + /** The status of the operation performed on the storage container [Succeeded, Failed, InProgress] */ + status?: Status; +} + +export function storageContainerStatusProvisioningStatusDeserializer( + item: any, +): StorageContainerStatusProvisioningStatus { + return { + operationId: item["operationId"], + status: item["status"], + }; +} + +/** The type used for updating tags in StorageContainer resources. */ +export interface StorageContainerTagsUpdate { + /** Resource tags. */ + tags?: Record; +} + +export function storageContainerTagsUpdateSerializer(item: StorageContainerTagsUpdate): any { + return { tags: item["tags"] }; +} + +/** The response of a StorageContainer list operation. */ +export interface _StorageContainerListResult { + /** The StorageContainer items on this page */ + value: StorageContainer[]; + /** The link to the next page of items */ + nextLink?: string; +} + +export function _storageContainerListResultDeserializer(item: any): _StorageContainerListResult { + return { + value: storageContainerArrayDeserializer(item["value"]), + nextLink: item["nextLink"], + }; +} + +export function storageContainerArraySerializer(result: Array): any[] { + return result.map((item) => { + return storageContainerSerializer(item); + }); +} + +export function storageContainerArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return storageContainerDeserializer(item); + }); +} + +/** The virtual hard disk resource definition. */ +export interface VirtualHardDisk extends TrackedResource { + /** The resource-specific properties for this resource. */ + properties?: VirtualHardDiskProperties; + /** The extendedLocation of the resource. */ + extendedLocation?: ExtendedLocation; +} + +export function virtualHardDiskSerializer(item: VirtualHardDisk): any { + return { + tags: item["tags"], + location: item["location"], + properties: !item["properties"] + ? item["properties"] + : virtualHardDiskPropertiesSerializer(item["properties"]), + extendedLocation: !item["extendedLocation"] + ? item["extendedLocation"] + : extendedLocationSerializer(item["extendedLocation"]), + }; +} + +export function virtualHardDiskDeserializer(item: any): VirtualHardDisk { + return { + tags: item["tags"], + location: item["location"], + id: item["id"], + name: item["name"], + type: item["type"], + systemData: !item["systemData"] + ? item["systemData"] + : systemDataDeserializer(item["systemData"]), + properties: !item["properties"] + ? item["properties"] + : virtualHardDiskPropertiesDeserializer(item["properties"]), + extendedLocation: !item["extendedLocation"] + ? item["extendedLocation"] + : extendedLocationDeserializer(item["extendedLocation"]), + }; +} + +/** Properties under the virtual hard disk resource */ +export interface VirtualHardDiskProperties { + /** Block size in bytes */ + blockSizeBytes?: number; + /** Size of the disk in GB */ + diskSizeGB?: number; + /** Boolean for enabling dynamic sizing on the virtual hard disk */ + dynamic?: boolean; + /** Logical sector in bytes */ + logicalSectorBytes?: number; + /** Physical sector in bytes */ + physicalSectorBytes?: number; + /** URL for downloading or accessing the virtual hard disk. This URL points to a secure link from where the VHD can be downloaded or accessed directly. */ + downloadUrl?: string; + /** The hypervisor generation of the Virtual Machine [V1, V2] */ + hyperVGeneration?: HyperVGeneration; + /** The format of the actual VHD file [vhd, vhdx] */ + diskFileFormat?: DiskFileFormat; + /** Boolean indicating whether it is an existing local hard disk or if one should be created. */ + createFromLocal?: boolean; + /** Provisioning state of the virtual hard disk. */ + readonly provisioningState?: ProvisioningStateEnum; + /** Storage ContainerID of the storage container to be used for VHD */ + containerId?: string; + /** The observed state of virtual hard disks */ + readonly status?: VirtualHardDiskStatus; + /** The maximum number of VMs that can attach to the disk at the same time. Value greater than one indicates a disk that can be mounted on multiple VMs at the same time. */ + maxShares?: number; +} + +export function virtualHardDiskPropertiesSerializer(item: VirtualHardDiskProperties): any { + return { + blockSizeBytes: item["blockSizeBytes"], + diskSizeGB: item["diskSizeGB"], + dynamic: item["dynamic"], + logicalSectorBytes: item["logicalSectorBytes"], + physicalSectorBytes: item["physicalSectorBytes"], + downloadUrl: item["downloadUrl"], + hyperVGeneration: item["hyperVGeneration"], + diskFileFormat: item["diskFileFormat"], + createFromLocal: item["createFromLocal"], + containerId: item["containerId"], + maxShares: item["maxShares"], + }; +} + +export function virtualHardDiskPropertiesDeserializer(item: any): VirtualHardDiskProperties { + return { + blockSizeBytes: item["blockSizeBytes"], + diskSizeGB: item["diskSizeGB"], + dynamic: item["dynamic"], + logicalSectorBytes: item["logicalSectorBytes"], + physicalSectorBytes: item["physicalSectorBytes"], + downloadUrl: item["downloadUrl"], + hyperVGeneration: item["hyperVGeneration"], + diskFileFormat: item["diskFileFormat"], + createFromLocal: item["createFromLocal"], + provisioningState: item["provisioningState"], + containerId: item["containerId"], + status: !item["status"] ? item["status"] : virtualHardDiskStatusDeserializer(item["status"]), + maxShares: item["maxShares"], + }; +} + +/** The format of the actual VHD file [vhd, vhdx] */ +export enum KnownDiskFileFormat { + /** VHDX file format */ + Vhdx = "vhdx", + /** VHD file format */ + Vhd = "vhd", +} + +/** + * The format of the actual VHD file [vhd, vhdx] \ + * {@link KnownDiskFileFormat} can be used interchangeably with DiskFileFormat, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **vhdx**: VHDX file format \ + * **vhd**: VHD file format + */ +export type DiskFileFormat = string; + +/** The observed state of virtual hard disks */ +export interface VirtualHardDiskStatus { + /** VirtualHardDisk provisioning error code */ + errorCode?: string; + /** Descriptive error message */ + errorMessage?: string; + /** Provisioning status of the vhd */ + provisioningStatus?: VirtualHardDiskStatusProvisioningStatus; + /** The download status of the virtual hard disk */ + downloadStatus?: VirtualHardDiskDownloadStatus; + /** The upload status of the virtual hard disk */ + uploadStatus?: VirtualHardDiskUploadStatus; + /** ARM IDs of the VMs that are consuming the VHD. */ + managedBy?: string[]; + /** Unique Guid identifying the resource. */ + uniqueId?: string; +} + +export function virtualHardDiskStatusDeserializer(item: any): VirtualHardDiskStatus { + return { + errorCode: item["errorCode"], + errorMessage: item["errorMessage"], + provisioningStatus: !item["provisioningStatus"] + ? item["provisioningStatus"] + : virtualHardDiskStatusProvisioningStatusDeserializer(item["provisioningStatus"]), + downloadStatus: !item["downloadStatus"] + ? item["downloadStatus"] + : virtualHardDiskDownloadStatusDeserializer(item["downloadStatus"]), + uploadStatus: !item["uploadStatus"] + ? item["uploadStatus"] + : virtualHardDiskUploadStatusDeserializer(item["uploadStatus"]), + managedBy: !item["managedBy"] + ? item["managedBy"] + : item["managedBy"].map((p: any) => { + return p; + }), + uniqueId: item["uniqueId"], + }; +} + +/** VHD Status provisioning status */ +export interface VirtualHardDiskStatusProvisioningStatus { + /** The ID of the operation performed on the virtual hard disk */ + operationId?: string; + /** The status of the operation performed on the virtual hard disk [Succeeded, Failed, InProgress] */ + status?: Status; +} + +export function virtualHardDiskStatusProvisioningStatusDeserializer( + item: any, +): VirtualHardDiskStatusProvisioningStatus { + return { + operationId: item["operationId"], + status: item["status"], + }; +} + +/** The download status of the virtual hard disk */ +export interface VirtualHardDiskDownloadStatus { + /** The downloaded sized of the virtual hard disk in MB */ + downloadedSizeInMB?: number; + /** The status of Uploading virtual hard disk [Succeeded, Failed, InProgress] */ + status?: Status; + /** The progress of the operation in percentage */ + progressPercentage?: number; +} + +export function virtualHardDiskDownloadStatusDeserializer( + item: any, +): VirtualHardDiskDownloadStatus { + return { + downloadedSizeInMB: item["downloadedSizeInMB"], + status: item["status"], + progressPercentage: item["progressPercentage"], + }; +} + +/** The upload status of the virtual hard disk */ +export interface VirtualHardDiskUploadStatus { + /** The uploaded sized of the virtual hard disk in MB */ + uploadedSizeInMB?: number; + /** The status of Uploading virtual hard disk [Succeeded, Failed, InProgress] */ + status?: Status; + /** The progress of the operation in percentage */ + progressPercentage?: number; + /** VirtualHardDisk upload error code */ + errorCode?: string; + /** Descriptive upload error message */ + errorMessage?: string; +} + +export function virtualHardDiskUploadStatusDeserializer(item: any): VirtualHardDiskUploadStatus { + return { + uploadedSizeInMB: item["uploadedSizeInMB"], + status: item["status"], + progressPercentage: item["progressPercentage"], + errorCode: item["errorCode"], + errorMessage: item["errorMessage"], + }; +} + +/** The virtual hard disk resource patch definition. */ +export interface VirtualHardDisksUpdateRequest { + /** Resource tags */ + tags?: Record; + /** Defines the resource properties for the update. */ + properties?: VirtualHardDisksUpdateProperties; +} + +export function virtualHardDisksUpdateRequestSerializer(item: VirtualHardDisksUpdateRequest): any { + return { + tags: item["tags"], + properties: !item["properties"] + ? item["properties"] + : virtualHardDisksUpdatePropertiesSerializer(item["properties"]), + }; +} + +/** Defines the resource properties for the update. */ +export interface VirtualHardDisksUpdateProperties { + /** Size of the disk in GB */ + diskSizeGB?: number; +} + +export function virtualHardDisksUpdatePropertiesSerializer( + item: VirtualHardDisksUpdateProperties, +): any { + return { diskSizeGB: item["diskSizeGB"] }; +} + +/** The response of a VirtualHardDisk list operation. */ +export interface _VirtualHardDiskListResult { + /** The VirtualHardDisk items on this page */ + value: VirtualHardDisk[]; + /** The link to the next page of items */ + nextLink?: string; +} + +export function _virtualHardDiskListResultDeserializer(item: any): _VirtualHardDiskListResult { + return { + value: virtualHardDiskArrayDeserializer(item["value"]), + nextLink: item["nextLink"], + }; +} + +export function virtualHardDiskArraySerializer(result: Array): any[] { + return result.map((item) => { + return virtualHardDiskSerializer(item); + }); +} + +export function virtualHardDiskArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return virtualHardDiskDeserializer(item); + }); +} + +/** Request for uploading virtual hard disk. */ +export interface VirtualHardDiskUploadRequest { + /** The Azure managed disk SAS URL to upload the virtual hard disk to. */ + azureManagedDiskUploadUrl: string; +} + +export function virtualHardDiskUploadRequestSerializer(item: VirtualHardDiskUploadRequest): any { + return { azureManagedDiskUploadUrl: item["azureManagedDiskUploadUrl"] }; +} + +/** Response for uploading virtual hard disk. */ +export interface VirtualHardDiskUploadResponse { + /** The ARM ID for a Virtual Hard Disk. */ + virtualHardDiskId?: string; + /** The upload status of the virtual hard disk */ + uploadStatus?: VirtualHardDiskUploadStatus; +} + +export function virtualHardDiskUploadResponseDeserializer( + item: any, +): VirtualHardDiskUploadResponse { + return { + virtualHardDiskId: item["virtualHardDiskId"], + uploadStatus: !item["uploadStatus"] + ? item["uploadStatus"] + : virtualHardDiskUploadStatusDeserializer(item["uploadStatus"]), + }; +} + +/** The virtual machine instance resource definition. */ +export interface VirtualMachineInstance extends ExtensionResource { + /** The resource-specific properties for this resource. */ + properties?: VirtualMachineInstanceProperties; + /** The extendedLocation of the resource. */ + extendedLocation?: ExtendedLocation; + /** The managed service identities assigned to this resource. */ + identity?: ManagedServiceIdentity; +} + +export function virtualMachineInstanceSerializer(item: VirtualMachineInstance): any { + return { + properties: !item["properties"] + ? item["properties"] + : virtualMachineInstancePropertiesSerializer(item["properties"]), + extendedLocation: !item["extendedLocation"] + ? item["extendedLocation"] + : extendedLocationSerializer(item["extendedLocation"]), + identity: !item["identity"] + ? item["identity"] + : managedServiceIdentitySerializer(item["identity"]), + }; +} + +export function virtualMachineInstanceDeserializer(item: any): VirtualMachineInstance { + return { + id: item["id"], + name: item["name"], + type: item["type"], + systemData: !item["systemData"] + ? item["systemData"] + : systemDataDeserializer(item["systemData"]), + properties: !item["properties"] + ? item["properties"] + : virtualMachineInstancePropertiesDeserializer(item["properties"]), + extendedLocation: !item["extendedLocation"] + ? item["extendedLocation"] + : extendedLocationDeserializer(item["extendedLocation"]), + identity: !item["identity"] + ? item["identity"] + : managedServiceIdentityDeserializer(item["identity"]), + }; +} + +/** Properties under the virtual machine instance resource */ +export interface VirtualMachineInstanceProperties { + /** HardwareProfile - Specifies the hardware settings for the virtual machine instance. */ + hardwareProfile?: VirtualMachineInstancePropertiesHardwareProfile; + /** PlacementProfile - Specifies the placement related settings for the virtual machine. */ + placementProfile?: VirtualMachineInstancePropertiesPlacementProfile; + /** NetworkProfile - describes the network configuration the virtual machine instance */ + networkProfile?: VirtualMachineInstancePropertiesNetworkProfile; + /** OsProfile - describes the configuration of the operating system and sets login data */ + osProfile?: VirtualMachineInstancePropertiesOsProfile; + /** SecurityProfile - Specifies the security settings for the virtual machine instance. */ + securityProfile?: VirtualMachineInstancePropertiesSecurityProfile; + /** StorageProfile - contains information about the disks and storage information for the virtual machine instance */ + storageProfile?: VirtualMachineInstancePropertiesStorageProfile; + /** HTTP Proxy configuration for the VM. */ + httpProxyConfig?: HttpProxyConfiguration; + /** Boolean indicating whether this is an existing local virtual machine or if one should be created. */ + createFromLocal?: boolean; + /** Provisioning state of the virtual machine instance. */ + readonly provisioningState?: ProvisioningStateEnum; + /** The virtual machine instance view. */ + readonly instanceView?: VirtualMachineInstanceView; + /** The observed state of virtual machine instances */ + readonly status?: VirtualMachineInstanceStatus; + /** Guest agent install status. */ + guestAgentInstallStatus?: GuestAgentInstallStatus; + /** Unique identifier for the vm resource. */ + readonly vmId?: string; + /** Unique identifier defined by ARC to identify the guest of the VM. */ + resourceUid?: string; + /** Unique identifier for the Hyper-V VM resource. */ + readonly hyperVVmId?: string; + /** Name of the host node that the VM is on. */ + readonly hostNodeName?: string; + /** Name of the host node that the VM is on. */ + readonly hostNodeIpAddress?: string; +} + +export function virtualMachineInstancePropertiesSerializer( + item: VirtualMachineInstanceProperties, +): any { + return { + hardwareProfile: !item["hardwareProfile"] + ? item["hardwareProfile"] + : virtualMachineInstancePropertiesHardwareProfileSerializer(item["hardwareProfile"]), + placementProfile: !item["placementProfile"] + ? item["placementProfile"] + : virtualMachineInstancePropertiesPlacementProfileSerializer(item["placementProfile"]), + networkProfile: !item["networkProfile"] + ? item["networkProfile"] + : virtualMachineInstancePropertiesNetworkProfileSerializer(item["networkProfile"]), + osProfile: !item["osProfile"] + ? item["osProfile"] + : virtualMachineInstancePropertiesOsProfileSerializer(item["osProfile"]), + securityProfile: !item["securityProfile"] + ? item["securityProfile"] + : virtualMachineInstancePropertiesSecurityProfileSerializer(item["securityProfile"]), + storageProfile: !item["storageProfile"] + ? item["storageProfile"] + : virtualMachineInstancePropertiesStorageProfileSerializer(item["storageProfile"]), + httpProxyConfig: !item["httpProxyConfig"] + ? item["httpProxyConfig"] + : httpProxyConfigurationSerializer(item["httpProxyConfig"]), + createFromLocal: item["createFromLocal"], + guestAgentInstallStatus: !item["guestAgentInstallStatus"] + ? item["guestAgentInstallStatus"] + : guestAgentInstallStatusSerializer(item["guestAgentInstallStatus"]), + resourceUid: item["resourceUid"], + }; +} + +export function virtualMachineInstancePropertiesDeserializer( + item: any, +): VirtualMachineInstanceProperties { + return { + hardwareProfile: !item["hardwareProfile"] + ? item["hardwareProfile"] + : virtualMachineInstancePropertiesHardwareProfileDeserializer(item["hardwareProfile"]), + placementProfile: !item["placementProfile"] + ? item["placementProfile"] + : virtualMachineInstancePropertiesPlacementProfileDeserializer(item["placementProfile"]), + networkProfile: !item["networkProfile"] + ? item["networkProfile"] + : virtualMachineInstancePropertiesNetworkProfileDeserializer(item["networkProfile"]), + osProfile: !item["osProfile"] + ? item["osProfile"] + : virtualMachineInstancePropertiesOsProfileDeserializer(item["osProfile"]), + securityProfile: !item["securityProfile"] + ? item["securityProfile"] + : virtualMachineInstancePropertiesSecurityProfileDeserializer(item["securityProfile"]), + storageProfile: !item["storageProfile"] + ? item["storageProfile"] + : virtualMachineInstancePropertiesStorageProfileDeserializer(item["storageProfile"]), + httpProxyConfig: !item["httpProxyConfig"] + ? item["httpProxyConfig"] + : httpProxyConfigurationDeserializer(item["httpProxyConfig"]), + createFromLocal: item["createFromLocal"], + provisioningState: item["provisioningState"], + instanceView: !item["instanceView"] + ? item["instanceView"] + : virtualMachineInstanceViewDeserializer(item["instanceView"]), + status: !item["status"] + ? item["status"] + : virtualMachineInstanceStatusDeserializer(item["status"]), + guestAgentInstallStatus: !item["guestAgentInstallStatus"] + ? item["guestAgentInstallStatus"] + : guestAgentInstallStatusDeserializer(item["guestAgentInstallStatus"]), + vmId: item["vmId"], + resourceUid: item["resourceUid"], + hyperVVmId: item["hyperVVmId"], + hostNodeName: item["hostNodeName"], + hostNodeIpAddress: item["hostNodeIpAddress"], + }; +} + +/** HardwareProfile - Specifies the hardware settings for the virtual machine instance. */ +export interface VirtualMachineInstancePropertiesHardwareProfile { + /** Enum of VM Sizes */ + vmSize?: VmSizeEnum; + /** number of processors for the virtual machine instance */ + processors?: number; + /** RAM in MB for the virtual machine instance */ + memoryMB?: number; + /** Dynamic memory config */ + dynamicMemoryConfig?: VirtualMachineInstancePropertiesHardwareProfileDynamicMemoryConfig; + /** virtualMachineGPUs - list of gpus to be attached to the virtual machine instance */ + virtualMachineGPUs?: VirtualMachineInstancePropertiesHardwareProfileVirtualMachineGPU[]; +} + +export function virtualMachineInstancePropertiesHardwareProfileSerializer( + item: VirtualMachineInstancePropertiesHardwareProfile, +): any { + return { + vmSize: item["vmSize"], + processors: item["processors"], + memoryMB: item["memoryMB"], + dynamicMemoryConfig: !item["dynamicMemoryConfig"] + ? item["dynamicMemoryConfig"] + : virtualMachineInstancePropertiesHardwareProfileDynamicMemoryConfigSerializer( + item["dynamicMemoryConfig"], + ), + virtualMachineGPUs: !item["virtualMachineGPUs"] + ? item["virtualMachineGPUs"] + : virtualMachineInstancePropertiesHardwareProfileVirtualMachineGPUArraySerializer( + item["virtualMachineGPUs"], + ), + }; +} + +export function virtualMachineInstancePropertiesHardwareProfileDeserializer( + item: any, +): VirtualMachineInstancePropertiesHardwareProfile { + return { + vmSize: item["vmSize"], + processors: item["processors"], + memoryMB: item["memoryMB"], + dynamicMemoryConfig: !item["dynamicMemoryConfig"] + ? item["dynamicMemoryConfig"] + : virtualMachineInstancePropertiesHardwareProfileDynamicMemoryConfigDeserializer( + item["dynamicMemoryConfig"], + ), + virtualMachineGPUs: !item["virtualMachineGPUs"] + ? item["virtualMachineGPUs"] + : virtualMachineInstancePropertiesHardwareProfileVirtualMachineGPUArrayDeserializer( + item["virtualMachineGPUs"], + ), + }; +} + +/** VM Sizes */ +export enum KnownVmSizeEnum { + /** Default virtual machine size */ + Default = "Default", + /** Standard A2 v2 virtual machine size */ + StandardA2V2 = "Standard_A2_v2", + /** Standard A4 v2 virtual machine size */ + StandardA4V2 = "Standard_A4_v2", + /** Standard D2s v3 virtual machine size */ + StandardD2SV3 = "Standard_D2s_v3", + /** Standard D4s v3 virtual machine size */ + StandardD4SV3 = "Standard_D4s_v3", + /** Standard D8s v3 virtual machine size */ + StandardD8SV3 = "Standard_D8s_v3", + /** Standard D16s v3 virtual machine size */ + StandardD16SV3 = "Standard_D16s_v3", + /** Standard D32s v3 virtual machine size */ + StandardD32SV3 = "Standard_D32s_v3", + /** Standard DS2 v2 virtual machine size */ + StandardDS2V2 = "Standard_DS2_v2", + /** Standard DS3 v2 virtual machine size */ + StandardDS3V2 = "Standard_DS3_v2", + /** Standard DS4 v2 virtual machine size */ + StandardDS4V2 = "Standard_DS4_v2", + /** Standard DS5 v2 virtual machine size */ + StandardDS5V2 = "Standard_DS5_v2", + /** Standard DS13 v2 virtual machine size */ + StandardDS13V2 = "Standard_DS13_v2", + /** Standard K8S v1 virtual machine size */ + StandardK8SV1 = "Standard_K8S_v1", + /** Standard K8S2 v1 virtual machine size */ + StandardK8S2V1 = "Standard_K8S2_v1", + /** Standard K8S3 v1 virtual machine size */ + StandardK8S3V1 = "Standard_K8S3_v1", + /** Standard K8S4 v1 virtual machine size */ + StandardK8S4V1 = "Standard_K8S4_v1", + /** Standard NK6 virtual machine size */ + StandardNK6 = "Standard_NK6", + /** Standard NK12 virtual machine size */ + StandardNK12 = "Standard_NK12", + /** Standard NV6 virtual machine size */ + StandardNV6 = "Standard_NV6", + /** Standard NV12 virtual machine size */ + StandardNV12 = "Standard_NV12", + /** Standard K8S5 v1 virtual machine size */ + StandardK8S5V1 = "Standard_K8S5_v1", + /** Custom virtual machine size */ + Custom = "Custom", +} + +/** + * VM Sizes \ + * {@link KnownVmSizeEnum} can be used interchangeably with VmSizeEnum, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Default**: Default virtual machine size \ + * **Standard_A2_v2**: Standard A2 v2 virtual machine size \ + * **Standard_A4_v2**: Standard A4 v2 virtual machine size \ + * **Standard_D2s_v3**: Standard D2s v3 virtual machine size \ + * **Standard_D4s_v3**: Standard D4s v3 virtual machine size \ + * **Standard_D8s_v3**: Standard D8s v3 virtual machine size \ + * **Standard_D16s_v3**: Standard D16s v3 virtual machine size \ + * **Standard_D32s_v3**: Standard D32s v3 virtual machine size \ + * **Standard_DS2_v2**: Standard DS2 v2 virtual machine size \ + * **Standard_DS3_v2**: Standard DS3 v2 virtual machine size \ + * **Standard_DS4_v2**: Standard DS4 v2 virtual machine size \ + * **Standard_DS5_v2**: Standard DS5 v2 virtual machine size \ + * **Standard_DS13_v2**: Standard DS13 v2 virtual machine size \ + * **Standard_K8S_v1**: Standard K8S v1 virtual machine size \ + * **Standard_K8S2_v1**: Standard K8S2 v1 virtual machine size \ + * **Standard_K8S3_v1**: Standard K8S3 v1 virtual machine size \ + * **Standard_K8S4_v1**: Standard K8S4 v1 virtual machine size \ + * **Standard_NK6**: Standard NK6 virtual machine size \ + * **Standard_NK12**: Standard NK12 virtual machine size \ + * **Standard_NV6**: Standard NV6 virtual machine size \ + * **Standard_NV12**: Standard NV12 virtual machine size \ + * **Standard_K8S5_v1**: Standard K8S5 v1 virtual machine size \ + * **Custom**: Custom virtual machine size + */ +export type VmSizeEnum = string; + +/** Dynamic memory config */ +export interface VirtualMachineInstancePropertiesHardwareProfileDynamicMemoryConfig { + /** Maximum memory in MB */ + maximumMemoryMB?: number; + /** Minimum memory in MB */ + minimumMemoryMB?: number; + /** Defines the amount of extra memory that should be reserved for a virtual machine instance at runtime, as a percentage of the total memory that the virtual machine instance is thought to need. This only applies to virtual systems with dynamic memory enabled. This property can be in the range of 5 to 2000. */ + targetMemoryBuffer?: number; +} + +export function virtualMachineInstancePropertiesHardwareProfileDynamicMemoryConfigSerializer( + item: VirtualMachineInstancePropertiesHardwareProfileDynamicMemoryConfig, +): any { + return { + maximumMemoryMB: item["maximumMemoryMB"], + minimumMemoryMB: item["minimumMemoryMB"], + targetMemoryBuffer: item["targetMemoryBuffer"], + }; +} + +export function virtualMachineInstancePropertiesHardwareProfileDynamicMemoryConfigDeserializer( + item: any, +): VirtualMachineInstancePropertiesHardwareProfileDynamicMemoryConfig { + return { + maximumMemoryMB: item["maximumMemoryMB"], + minimumMemoryMB: item["minimumMemoryMB"], + targetMemoryBuffer: item["targetMemoryBuffer"], + }; +} + +export function virtualMachineInstancePropertiesHardwareProfileVirtualMachineGPUArraySerializer( + result: Array, +): any[] { + return result.map((item) => { + return virtualMachineInstancePropertiesHardwareProfileVirtualMachineGPUSerializer(item); + }); +} + +export function virtualMachineInstancePropertiesHardwareProfileVirtualMachineGPUArrayDeserializer( + result: Array, +): any[] { + return result.map((item) => { + return virtualMachineInstancePropertiesHardwareProfileVirtualMachineGPUDeserializer(item); + }); +} + +/** GPU properties - describes the GPU configuration. */ +export interface VirtualMachineInstancePropertiesHardwareProfileVirtualMachineGPU { + /** GPU assignment type */ + assignmentType: GpuAssignmentTypeEnum; + /** Size of gpu partition in MB for GPU-P */ + partitionSizeMB?: number; + /** Name of the GPU */ + gpuName?: string; +} + +export function virtualMachineInstancePropertiesHardwareProfileVirtualMachineGPUSerializer( + item: VirtualMachineInstancePropertiesHardwareProfileVirtualMachineGPU, +): any { + return { + assignmentType: item["assignmentType"], + partitionSizeMB: item["partitionSizeMB"], + gpuName: item["gpuName"], + }; +} + +export function virtualMachineInstancePropertiesHardwareProfileVirtualMachineGPUDeserializer( + item: any, +): VirtualMachineInstancePropertiesHardwareProfileVirtualMachineGPU { + return { + assignmentType: item["assignmentType"], + partitionSizeMB: item["partitionSizeMB"], + gpuName: item["gpuName"], + }; +} + +/** Gpu Assignment types */ +export enum KnownGpuAssignmentTypeEnum { + /** Attach Graphics Processing Unit (GPU) using Discrete Device Assignment (DDA) */ + GpuDDA = "GpuDDA", + /** Attach Graphics Processing Unit (GPU) using GPU Partitioning */ + GpuP = "GpuP", +} + +/** + * Gpu Assignment types \ + * {@link KnownGpuAssignmentTypeEnum} can be used interchangeably with GpuAssignmentTypeEnum, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **GpuDDA**: Attach Graphics Processing Unit (GPU) using Discrete Device Assignment (DDA) \ + * **GpuP**: Attach Graphics Processing Unit (GPU) using GPU Partitioning + */ +export type GpuAssignmentTypeEnum = string; + +/** PlacementProfile - Specifies the placement related settings for the virtual machine. */ +export interface VirtualMachineInstancePropertiesPlacementProfile { + /** The zone in which the VM should be placed in. */ + zone?: string; + /** Specifies whether VM can only failover strictly within the zone it was placed in */ + strictPlacementPolicy?: boolean; +} + +export function virtualMachineInstancePropertiesPlacementProfileSerializer( + item: VirtualMachineInstancePropertiesPlacementProfile, +): any { + return { + zone: item["zone"], + strictPlacementPolicy: item["strictPlacementPolicy"], + }; +} + +export function virtualMachineInstancePropertiesPlacementProfileDeserializer( + item: any, +): VirtualMachineInstancePropertiesPlacementProfile { + return { + zone: item["zone"], + strictPlacementPolicy: item["strictPlacementPolicy"], + }; +} + +/** NetworkProfile - describes the network configuration the virtual machine instance */ +export interface VirtualMachineInstancePropertiesNetworkProfile { + /** NetworkInterfaces - list of network interfaces to be attached to the virtual machine instance */ + networkInterfaces?: NetworkInterfaceArmReference[]; +} + +export function virtualMachineInstancePropertiesNetworkProfileSerializer( + item: VirtualMachineInstancePropertiesNetworkProfile, +): any { + return { + networkInterfaces: !item["networkInterfaces"] + ? item["networkInterfaces"] + : networkInterfaceArmReferenceArraySerializer(item["networkInterfaces"]), + }; +} + +export function virtualMachineInstancePropertiesNetworkProfileDeserializer( + item: any, +): VirtualMachineInstancePropertiesNetworkProfile { + return { + networkInterfaces: !item["networkInterfaces"] + ? item["networkInterfaces"] + : networkInterfaceArmReferenceArrayDeserializer(item["networkInterfaces"]), + }; +} + +/** OsProfile - describes the configuration of the operating system and sets login data */ +export interface VirtualMachineInstancePropertiesOsProfile { + /** AdminPassword - admin password */ + adminPassword?: string; + /** AdminUsername - admin username */ + adminUsername?: string; + /** ComputerName - name of the compute */ + computerName?: string; + /** LinuxConfiguration - linux specific configuration values for the virtual machine instance */ + linuxConfiguration?: VirtualMachineInstancePropertiesOsProfileLinuxConfiguration; + /** Windows Configuration for the virtual machine instance */ + windowsConfiguration?: VirtualMachineInstancePropertiesOsProfileWindowsConfiguration; +} + +export function virtualMachineInstancePropertiesOsProfileSerializer( + item: VirtualMachineInstancePropertiesOsProfile, +): any { + return { + adminPassword: item["adminPassword"], + adminUsername: item["adminUsername"], + computerName: item["computerName"], + linuxConfiguration: !item["linuxConfiguration"] + ? item["linuxConfiguration"] + : virtualMachineInstancePropertiesOsProfileLinuxConfigurationSerializer( + item["linuxConfiguration"], + ), + windowsConfiguration: !item["windowsConfiguration"] + ? item["windowsConfiguration"] + : virtualMachineInstancePropertiesOsProfileWindowsConfigurationSerializer( + item["windowsConfiguration"], + ), + }; +} + +export function virtualMachineInstancePropertiesOsProfileDeserializer( + item: any, +): VirtualMachineInstancePropertiesOsProfile { + return { + adminPassword: item["adminPassword"], + adminUsername: item["adminUsername"], + computerName: item["computerName"], + linuxConfiguration: !item["linuxConfiguration"] + ? item["linuxConfiguration"] + : virtualMachineInstancePropertiesOsProfileLinuxConfigurationDeserializer( + item["linuxConfiguration"], + ), + windowsConfiguration: !item["windowsConfiguration"] + ? item["windowsConfiguration"] + : virtualMachineInstancePropertiesOsProfileWindowsConfigurationDeserializer( + item["windowsConfiguration"], + ), + }; +} + +/** LinuxConfiguration - linux specific configuration values for the virtual machine instance */ +export interface VirtualMachineInstancePropertiesOsProfileLinuxConfiguration { + /** DisablePasswordAuthentication - whether password authentication should be disabled */ + disablePasswordAuthentication?: boolean; + /** Specifies the ssh key configuration for a Linux OS. */ + ssh?: SshConfiguration; + /** Used to indicate whether Arc for Servers agent onboarding should be triggered during the virtual machine instance creation process. */ + provisionVMAgent?: boolean; + /** Used to indicate whether the VM Config Agent should be installed during the virtual machine creation process. */ + provisionVMConfigAgent?: boolean; +} + +export function virtualMachineInstancePropertiesOsProfileLinuxConfigurationSerializer( + item: VirtualMachineInstancePropertiesOsProfileLinuxConfiguration, +): any { + return { + disablePasswordAuthentication: item["disablePasswordAuthentication"], + ssh: !item["ssh"] ? item["ssh"] : sshConfigurationSerializer(item["ssh"]), + provisionVMAgent: item["provisionVMAgent"], + provisionVMConfigAgent: item["provisionVMConfigAgent"], + }; +} + +export function virtualMachineInstancePropertiesOsProfileLinuxConfigurationDeserializer( + item: any, +): VirtualMachineInstancePropertiesOsProfileLinuxConfiguration { + return { + disablePasswordAuthentication: item["disablePasswordAuthentication"], + ssh: !item["ssh"] ? item["ssh"] : sshConfigurationDeserializer(item["ssh"]), + provisionVMAgent: item["provisionVMAgent"], + provisionVMConfigAgent: item["provisionVMConfigAgent"], + }; +} + +/** SSH configuration for Linux based VMs running on Azure */ +export interface SshConfiguration { + /** The list of SSH public keys used to authenticate with linux based VMs. */ + publicKeys?: SshPublicKey[]; +} + +export function sshConfigurationSerializer(item: SshConfiguration): any { + return { + publicKeys: !item["publicKeys"] + ? item["publicKeys"] + : sshPublicKeyArraySerializer(item["publicKeys"]), + }; +} + +export function sshConfigurationDeserializer(item: any): SshConfiguration { + return { + publicKeys: !item["publicKeys"] + ? item["publicKeys"] + : sshPublicKeyArrayDeserializer(item["publicKeys"]), + }; +} + +export function sshPublicKeyArraySerializer(result: Array): any[] { + return result.map((item) => { + return sshPublicKeySerializer(item); + }); +} + +export function sshPublicKeyArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return sshPublicKeyDeserializer(item); + }); +} + +/** Contains information about SSH certificate public key and the path on the Linux VM where the public key is placed. */ +export interface SshPublicKey { + /** Specifies the full path on the created VM where ssh public key is stored. If the file already exists, the specified key is appended to the file. Example: /home/user/.ssh/authorized_keys */ + path?: string; + /** SSH public key certificate used to authenticate with the VM through ssh. The key needs to be at least 2048-bit and in ssh-rsa format.

For creating ssh keys, see [Create SSH keys on Linux and Mac for Linux VMs in Azure]https://learn.microsoft.com/azure/virtual-machines/linux/create-ssh-keys-detailed). */ + keyData?: string; +} + +export function sshPublicKeySerializer(item: SshPublicKey): any { + return { path: item["path"], keyData: item["keyData"] }; +} + +export function sshPublicKeyDeserializer(item: any): SshPublicKey { + return { + path: item["path"], + keyData: item["keyData"], + }; +} + +/** Windows Configuration for the virtual machine instance */ +export interface VirtualMachineInstancePropertiesOsProfileWindowsConfiguration { + /** Whether to EnableAutomaticUpdates on the machine */ + enableAutomaticUpdates?: boolean; + /** Specifies the ssh key configuration for Windows OS. */ + ssh?: SshConfiguration; + /** TimeZone for the virtual machine instance */ + timeZone?: string; + /** Used to indicate whether Arc for Servers agent onboarding should be triggered during the virtual machine instance creation process. */ + provisionVMAgent?: boolean; + /** Used to indicate whether the VM Config Agent should be installed during the virtual machine creation process. */ + provisionVMConfigAgent?: boolean; +} + +export function virtualMachineInstancePropertiesOsProfileWindowsConfigurationSerializer( + item: VirtualMachineInstancePropertiesOsProfileWindowsConfiguration, +): any { + return { + enableAutomaticUpdates: item["enableAutomaticUpdates"], + ssh: !item["ssh"] ? item["ssh"] : sshConfigurationSerializer(item["ssh"]), + timeZone: item["timeZone"], + provisionVMAgent: item["provisionVMAgent"], + provisionVMConfigAgent: item["provisionVMConfigAgent"], + }; +} + +export function virtualMachineInstancePropertiesOsProfileWindowsConfigurationDeserializer( + item: any, +): VirtualMachineInstancePropertiesOsProfileWindowsConfiguration { + return { + enableAutomaticUpdates: item["enableAutomaticUpdates"], + ssh: !item["ssh"] ? item["ssh"] : sshConfigurationDeserializer(item["ssh"]), + timeZone: item["timeZone"], + provisionVMAgent: item["provisionVMAgent"], + provisionVMConfigAgent: item["provisionVMConfigAgent"], + }; +} + +/** SecurityProfile - Specifies the security settings for the virtual machine instance. */ +export interface VirtualMachineInstancePropertiesSecurityProfile { + /** Enable TPM flag */ + enableTPM?: boolean; + /** Uefi settings of the virtual machine instance */ + uefiSettings?: VirtualMachineInstancePropertiesSecurityProfileUefiSettings; + /** Specifies the SecurityType of the virtual machine. EnableTPM and SecureBootEnabled must be set to true for SecurityType to function. */ + securityType?: SecurityTypes; +} + +export function virtualMachineInstancePropertiesSecurityProfileSerializer( + item: VirtualMachineInstancePropertiesSecurityProfile, +): any { + return { + enableTPM: item["enableTPM"], + uefiSettings: !item["uefiSettings"] + ? item["uefiSettings"] + : virtualMachineInstancePropertiesSecurityProfileUefiSettingsSerializer(item["uefiSettings"]), + securityType: item["securityType"], + }; +} + +export function virtualMachineInstancePropertiesSecurityProfileDeserializer( + item: any, +): VirtualMachineInstancePropertiesSecurityProfile { + return { + enableTPM: item["enableTPM"], + uefiSettings: !item["uefiSettings"] + ? item["uefiSettings"] + : virtualMachineInstancePropertiesSecurityProfileUefiSettingsDeserializer( + item["uefiSettings"], + ), + securityType: item["securityType"], + }; +} + +/** Uefi settings - Specifies whether secure boot should be enabled on the virtual machine instance. */ +export interface VirtualMachineInstancePropertiesSecurityProfileUefiSettings { + /** Specifies whether secure boot should be enabled on the virtual machine instance. */ + secureBootEnabled?: boolean; +} + +export function virtualMachineInstancePropertiesSecurityProfileUefiSettingsSerializer( + item: VirtualMachineInstancePropertiesSecurityProfileUefiSettings, +): any { + return { secureBootEnabled: item["secureBootEnabled"] }; +} + +export function virtualMachineInstancePropertiesSecurityProfileUefiSettingsDeserializer( + item: any, +): VirtualMachineInstancePropertiesSecurityProfileUefiSettings { + return { + secureBootEnabled: item["secureBootEnabled"], + }; +} + +/** Specifies the SecurityType of the virtual machine. EnableTPM and SecureBootEnabled must be set to true for SecurityType to function. */ +export enum KnownSecurityTypes { + /** Trusted Launch security type */ + TrustedLaunch = "TrustedLaunch", + /** Confidential VM security type */ + ConfidentialVM = "ConfidentialVM", +} + +/** + * Specifies the SecurityType of the virtual machine. EnableTPM and SecureBootEnabled must be set to true for SecurityType to function. \ + * {@link KnownSecurityTypes} can be used interchangeably with SecurityTypes, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **TrustedLaunch**: Trusted Launch security type \ + * **ConfidentialVM**: Confidential VM security type + */ +export type SecurityTypes = string; + +/** StorageProfile - contains information about the disks and storage information for the virtual machine instance */ +export interface VirtualMachineInstancePropertiesStorageProfile { + /** adds data disks to the virtual machine instance */ + dataDisks?: VirtualHardDiskArmReference[]; + /** Which Image to use for the virtual machine instance */ + imageReference?: ImageArmReference; + /** VHD to attach as OS disk */ + osDisk?: VirtualMachineInstancePropertiesStorageProfileOsDisk; + /** Id of the storage container that hosts the VM configuration file */ + vmConfigStoragePathId?: string; +} + +export function virtualMachineInstancePropertiesStorageProfileSerializer( + item: VirtualMachineInstancePropertiesStorageProfile, +): any { + return { + dataDisks: !item["dataDisks"] + ? item["dataDisks"] + : virtualHardDiskArmReferenceArraySerializer(item["dataDisks"]), + imageReference: !item["imageReference"] + ? item["imageReference"] + : imageArmReferenceSerializer(item["imageReference"]), + osDisk: !item["osDisk"] + ? item["osDisk"] + : virtualMachineInstancePropertiesStorageProfileOsDiskSerializer(item["osDisk"]), + vmConfigStoragePathId: item["vmConfigStoragePathId"], + }; +} + +export function virtualMachineInstancePropertiesStorageProfileDeserializer( + item: any, +): VirtualMachineInstancePropertiesStorageProfile { + return { + dataDisks: !item["dataDisks"] + ? item["dataDisks"] + : virtualHardDiskArmReferenceArrayDeserializer(item["dataDisks"]), + imageReference: !item["imageReference"] + ? item["imageReference"] + : imageArmReferenceDeserializer(item["imageReference"]), + osDisk: !item["osDisk"] + ? item["osDisk"] + : virtualMachineInstancePropertiesStorageProfileOsDiskDeserializer(item["osDisk"]), + vmConfigStoragePathId: item["vmConfigStoragePathId"], + }; +} + +export function virtualHardDiskArmReferenceArraySerializer( + result: Array, +): any[] { + return result.map((item) => { + return virtualHardDiskArmReferenceSerializer(item); + }); +} + +export function virtualHardDiskArmReferenceArrayDeserializer( + result: Array, +): any[] { + return result.map((item) => { + return virtualHardDiskArmReferenceDeserializer(item); + }); +} + +/** The ARM ID for a Virtual Hard Disk. */ +export interface VirtualHardDiskArmReference { + /** The ARM ID for a Virtual Hard Disk. */ + id?: string; +} + +export function virtualHardDiskArmReferenceSerializer(item: VirtualHardDiskArmReference): any { + return { id: item["id"] }; +} + +export function virtualHardDiskArmReferenceDeserializer(item: any): VirtualHardDiskArmReference { + return { + id: item["id"], + }; +} + +/** The ARM ID for a Gallery Image. */ +export interface ImageArmReference { + /** The ARM ID for an image resource used by the virtual machine instance. */ + id?: string; +} + +export function imageArmReferenceSerializer(item: ImageArmReference): any { + return { id: item["id"] }; +} + +export function imageArmReferenceDeserializer(item: any): ImageArmReference { + return { + id: item["id"], + }; +} + +/** VHD to attach as OS disk */ +export interface VirtualMachineInstancePropertiesStorageProfileOsDisk { + /** The ARM ID for a Virtual Hard Disk. */ + id?: string; + /** This property allows you to specify the type of the OS that is included in the disk if creating a VM from user-image or a specialized VHD. Possible values are: Windows, Linux. */ + osType?: OperatingSystemTypes; + /** The managed disk parameters. */ + managedDisk?: VirtualMachineInstanceManagedDiskParameters; +} + +export function virtualMachineInstancePropertiesStorageProfileOsDiskSerializer( + item: VirtualMachineInstancePropertiesStorageProfileOsDisk, +): any { + return { + id: item["id"], + osType: item["osType"], + managedDisk: !item["managedDisk"] + ? item["managedDisk"] + : virtualMachineInstanceManagedDiskParametersSerializer(item["managedDisk"]), + }; +} + +export function virtualMachineInstancePropertiesStorageProfileOsDiskDeserializer( + item: any, +): VirtualMachineInstancePropertiesStorageProfileOsDisk { + return { + id: item["id"], + osType: item["osType"], + managedDisk: !item["managedDisk"] + ? item["managedDisk"] + : virtualMachineInstanceManagedDiskParametersDeserializer(item["managedDisk"]), + }; +} + +/** The parameters of a managed disk. */ +export interface VirtualMachineInstanceManagedDiskParameters { + /** Specifies the security profile for the managed disk. */ + securityProfile?: VMDiskSecurityProfile; +} + +export function virtualMachineInstanceManagedDiskParametersSerializer( + item: VirtualMachineInstanceManagedDiskParameters, +): any { + return { + securityProfile: !item["securityProfile"] + ? item["securityProfile"] + : vmDiskSecurityProfileSerializer(item["securityProfile"]), + }; +} + +export function virtualMachineInstanceManagedDiskParametersDeserializer( + item: any, +): VirtualMachineInstanceManagedDiskParameters { + return { + securityProfile: !item["securityProfile"] + ? item["securityProfile"] + : vmDiskSecurityProfileDeserializer(item["securityProfile"]), + }; +} + +/** Specifies the security profile settings for the managed disk. NOTE: It can only be set for Confidential VMs */ +export interface VMDiskSecurityProfile { + /** Specifies the EncryptionType of the managed disk. It is set to NonPersistedTPM for not persisting firmware state in the VMGuestState blob. NOTE: It can be set for only Confidential VMs. */ + securityEncryptionType?: SecurityEncryptionType; +} + +export function vmDiskSecurityProfileSerializer(item: VMDiskSecurityProfile): any { + return { securityEncryptionType: item["securityEncryptionType"] }; +} + +export function vmDiskSecurityProfileDeserializer(item: any): VMDiskSecurityProfile { + return { + securityEncryptionType: item["securityEncryptionType"], + }; +} + +/** Encryption type of the managed disk enum. */ +export enum KnownSecurityEncryptionType { + /** Non-persisted TPM encryption type */ + NonPersistedTPM = "NonPersistedTPM", +} + +/** + * Encryption type of the managed disk enum. \ + * {@link KnownSecurityEncryptionType} can be used interchangeably with SecurityEncryptionType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **NonPersistedTPM**: Non-persisted TPM encryption type + */ +export type SecurityEncryptionType = string; + +/** HTTP Proxy configuration for the VM. */ +export interface HttpProxyConfiguration { + /** The HTTP proxy server endpoint to use. */ + httpProxy?: string; + /** The HTTPS proxy server endpoint to use. */ + httpsProxy?: string; + /** The endpoints that should not go through proxy. */ + noProxy?: string[]; + /** Alternative CA cert to use for connecting to proxy servers. */ + trustedCa?: string; +} + +export function httpProxyConfigurationSerializer(item: HttpProxyConfiguration): any { + return { + httpProxy: item["httpProxy"], + httpsProxy: item["httpsProxy"], + noProxy: !item["noProxy"] + ? item["noProxy"] + : item["noProxy"].map((p: any) => { + return p; + }), + trustedCa: item["trustedCa"], + }; +} + +export function httpProxyConfigurationDeserializer(item: any): HttpProxyConfiguration { + return { + httpProxy: item["httpProxy"], + httpsProxy: item["httpsProxy"], + noProxy: !item["noProxy"] + ? item["noProxy"] + : item["noProxy"].map((p: any) => { + return p; + }), + trustedCa: item["trustedCa"], + }; +} + +/** The instance view of a virtual machine. */ +export interface VirtualMachineInstanceView { + /** The VM Config Agent running on the virtual machine. */ + vmAgent?: VirtualMachineConfigAgentInstanceView; +} + +export function virtualMachineInstanceViewDeserializer(item: any): VirtualMachineInstanceView { + return { + vmAgent: !item["vmAgent"] + ? item["vmAgent"] + : virtualMachineConfigAgentInstanceViewDeserializer(item["vmAgent"]), + }; +} + +/** The instance view of the VM Config Agent running on the virtual machine. */ +export interface VirtualMachineConfigAgentInstanceView { + /** The VM Config Agent full version. */ + vmConfigAgentVersion?: string; + /** The resource status information. */ + statuses?: InstanceViewStatus[]; +} + +export function virtualMachineConfigAgentInstanceViewDeserializer( + item: any, +): VirtualMachineConfigAgentInstanceView { + return { + vmConfigAgentVersion: item["vmConfigAgentVersion"], + statuses: !item["statuses"] + ? item["statuses"] + : instanceViewStatusArrayDeserializer(item["statuses"]), + }; +} + +export function instanceViewStatusArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return instanceViewStatusDeserializer(item); + }); +} + +/** Instance view status. */ +export interface InstanceViewStatus { + /** The status code. */ + code?: string; + /** The level code. */ + level?: StatusLevelTypes; + /** The short localizable label for the status. */ + displayStatus?: string; + /** The detailed status message, including for alerts and error messages. */ + message?: string; + /** The time of the status. */ + time?: Date; +} + +export function instanceViewStatusDeserializer(item: any): InstanceViewStatus { + return { + code: item["code"], + level: item["level"], + displayStatus: item["displayStatus"], + message: item["message"], + time: !item["time"] ? item["time"] : new Date(item["time"]), + }; +} + +/** The level code. */ +export enum KnownStatusLevelTypes { + /** Informational status level */ + Info = "Info", + /** Warning status level */ + Warning = "Warning", + /** Error status level */ + Error = "Error", +} + +/** + * The level code. \ + * {@link KnownStatusLevelTypes} can be used interchangeably with StatusLevelTypes, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Info**: Informational status level \ + * **Warning**: Warning status level \ + * **Error**: Error status level + */ +export type StatusLevelTypes = string; + +/** The observed state of virtual machine instances */ +export interface VirtualMachineInstanceStatus { + /** VirtualMachine provisioning error code */ + errorCode?: string; + /** Descriptive error message */ + errorMessage?: string; + /** The power state of the virtual machine instance */ + powerState?: PowerStateEnum; + /** Provisioning status of the virtual machine instance */ + provisioningStatus?: VirtualMachineInstanceStatusProvisioningStatus; +} + +export function virtualMachineInstanceStatusDeserializer(item: any): VirtualMachineInstanceStatus { + return { + errorCode: item["errorCode"], + errorMessage: item["errorMessage"], + powerState: item["powerState"], + provisioningStatus: !item["provisioningStatus"] + ? item["provisioningStatus"] + : virtualMachineInstanceStatusProvisioningStatusDeserializer(item["provisioningStatus"]), + }; +} + +/** The power state of the virtual machine instance */ +export enum KnownPowerStateEnum { + /** Virtual machine deallocated */ + Deallocated = "Deallocated", + /** Virtual machine deallocating */ + Deallocating = "Deallocating", + /** Virtual machine running */ + Running = "Running", + /** Virtual machine starting */ + Starting = "Starting", + /** Virtual machine stopped */ + Stopped = "Stopped", + /** Virtual machine stopping */ + Stopping = "Stopping", + /** Virtual machine paused */ + Paused = "Paused", + /** Virtual machine Saved, */ + Saved = "Saved", + /** Power state of the virtual machine is unknown */ + Unknown = "Unknown", +} + +/** + * The power state of the virtual machine instance \ + * {@link KnownPowerStateEnum} can be used interchangeably with PowerStateEnum, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Deallocated**: Virtual machine deallocated \ + * **Deallocating**: Virtual machine deallocating \ + * **Running**: Virtual machine running \ + * **Starting**: Virtual machine starting \ + * **Stopped**: Virtual machine stopped \ + * **Stopping**: Virtual machine stopping \ + * **Paused**: Virtual machine paused \ + * **Saved**: Virtual machine Saved, \ + * **Unknown**: Power state of the virtual machine is unknown + */ +export type PowerStateEnum = string; + +/** Virtual machine instance provisioning status. */ +export interface VirtualMachineInstanceStatusProvisioningStatus { + /** The ID of the operation performed on the virtual machine instance */ + operationId?: string; + /** The status of the operation performed on the virtual machine instance [Succeeded, Failed, InProgress] */ + status?: Status; +} + +export function virtualMachineInstanceStatusProvisioningStatusDeserializer( + item: any, +): VirtualMachineInstanceStatusProvisioningStatus { + return { + operationId: item["operationId"], + status: item["status"], + }; +} + +/** Defines the status of a guest agent installation. */ +export interface GuestAgentInstallStatus { + /** Specifies the VM's unique SMBIOS ID. */ + readonly vmUuid?: string; + /** The installation status of the hybrid machine agent installation. */ + readonly status?: StatusTypes; + /** The time of the last status change. */ + readonly lastStatusChange?: Date; + /** The hybrid machine agent full version. */ + readonly agentVersion?: string; + /** Details about the error state. */ + readonly errorDetails?: ErrorDetail[]; +} + +export function guestAgentInstallStatusSerializer(item: GuestAgentInstallStatus): any { + return item; +} + +export function guestAgentInstallStatusDeserializer(item: any): GuestAgentInstallStatus { + return { + vmUuid: item["vmUuid"], + status: item["status"], + lastStatusChange: !item["lastStatusChange"] + ? item["lastStatusChange"] + : new Date(item["lastStatusChange"]), + agentVersion: item["agentVersion"], + errorDetails: !item["errorDetails"] + ? item["errorDetails"] + : errorDetailArrayDeserializer(item["errorDetails"]), + }; +} + +/** The installation status of the hybrid machine agent installation. */ +export enum KnownStatusTypes { + /** Installation succeeded */ + Succeeded = "Succeeded", + /** Installation in progress */ + InProgress = "InProgress", + /** Installation failed */ + Failed = "Failed", +} + +/** + * The installation status of the hybrid machine agent installation. \ + * {@link KnownStatusTypes} can be used interchangeably with StatusTypes, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Succeeded**: Installation succeeded \ + * **InProgress**: Installation in progress \ + * **Failed**: Installation failed + */ +export type StatusTypes = string; + +/** Managed service identity (system assigned and/or user assigned identities) */ +export interface ManagedServiceIdentity { + /** The service principal ID of the system assigned identity. This property will only be provided for a system assigned identity. */ + readonly principalId?: string; + /** The tenant ID of the system assigned identity. This property will only be provided for a system assigned identity. */ + readonly tenantId?: string; + /** The type of managed identity assigned to this resource. */ + type: ManagedServiceIdentityType; + /** The identities assigned to this resource by the user. */ + userAssignedIdentities?: Record; +} + +export function managedServiceIdentitySerializer(item: ManagedServiceIdentity): any { + return { + type: item["type"], + userAssignedIdentities: item["userAssignedIdentities"], + }; +} + +export function managedServiceIdentityDeserializer(item: any): ManagedServiceIdentity { + return { + principalId: item["principalId"], + tenantId: item["tenantId"], + type: item["type"], + userAssignedIdentities: item["userAssignedIdentities"], + }; +} + +/** Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). */ +export enum KnownManagedServiceIdentityType { + /** No managed identity. */ + None = "None", + /** System assigned managed identity. */ + SystemAssigned = "SystemAssigned", + /** User assigned managed identity. */ + UserAssigned = "UserAssigned", + /** System and user assigned managed identity. */ + SystemAssignedUserAssigned = "SystemAssigned,UserAssigned", +} + +/** + * Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). \ + * {@link KnownManagedServiceIdentityType} can be used interchangeably with ManagedServiceIdentityType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **None**: No managed identity. \ + * **SystemAssigned**: System assigned managed identity. \ + * **UserAssigned**: User assigned managed identity. \ + * **SystemAssigned,UserAssigned**: System and user assigned managed identity. + */ +export type ManagedServiceIdentityType = string; + +/** User assigned identity properties */ +export interface UserAssignedIdentity { + /** The principal ID of the assigned identity. */ + readonly principalId?: string; + /** The client ID of the assigned identity. */ + readonly clientId?: string; +} + +export function userAssignedIdentitySerializer(item: UserAssignedIdentity): any { + return item; +} + +export function userAssignedIdentityDeserializer(item: any): UserAssignedIdentity { + return { + principalId: item["principalId"], + clientId: item["clientId"], + }; +} + +/** The base extension resource. */ +export interface ExtensionResource extends Resource {} + +export function extensionResourceSerializer(item: ExtensionResource): any { + return item; +} + +export function extensionResourceDeserializer(item: any): ExtensionResource { + return { + id: item["id"], + name: item["name"], + type: item["type"], + systemData: !item["systemData"] + ? item["systemData"] + : systemDataDeserializer(item["systemData"]), + }; +} + +/** The virtual machine instance resource patch definition. */ +export interface VirtualMachineInstanceUpdateRequest { + /** Defines the resource properties for the update. */ + properties?: VirtualMachineInstanceUpdateProperties; + /** Identity for the resource. */ + identity?: Identity; +} + +export function virtualMachineInstanceUpdateRequestSerializer( + item: VirtualMachineInstanceUpdateRequest, +): any { + return { + properties: !item["properties"] + ? item["properties"] + : virtualMachineInstanceUpdatePropertiesSerializer(item["properties"]), + identity: !item["identity"] ? item["identity"] : identitySerializer(item["identity"]), + }; +} + +/** Defines the resource properties for the update. */ +export interface VirtualMachineInstanceUpdateProperties { + /** HardwareProfile - Specifies the hardware settings for the virtual machine instance. */ + hardwareProfile?: HardwareProfileUpdate; + /** StorageProfile - Specifies the storage settings for the virtual machine instance. */ + storageProfile?: StorageProfileUpdate; + /** NetworkProfile - describes the network update configuration the virtual machine instance */ + networkProfile?: NetworkProfileUpdate; + /** OsProfile - describes the update configuration of the operating system */ + osProfile?: OsProfileUpdate; +} + +export function virtualMachineInstanceUpdatePropertiesSerializer( + item: VirtualMachineInstanceUpdateProperties, +): any { + return { + hardwareProfile: !item["hardwareProfile"] + ? item["hardwareProfile"] + : hardwareProfileUpdateSerializer(item["hardwareProfile"]), + storageProfile: !item["storageProfile"] + ? item["storageProfile"] + : storageProfileUpdateSerializer(item["storageProfile"]), + networkProfile: !item["networkProfile"] + ? item["networkProfile"] + : networkProfileUpdateSerializer(item["networkProfile"]), + osProfile: !item["osProfile"] + ? item["osProfile"] + : osProfileUpdateSerializer(item["osProfile"]), + }; +} + +/** HardwareProfile - Specifies the hardware settings for the virtual machine instance. */ +export interface HardwareProfileUpdate { + /** VM Size Enum */ + vmSize?: VmSizeEnum; + /** number of processors for the virtual machine instance */ + processors?: number; + /** RAM in MB for the virtual machine instance */ + memoryMB?: number; + /** virtualMachineGPUs - updated list of GPUs on the virtual machine instance */ + virtualMachineGPUs?: VirtualMachineInstancePropertiesHardwareProfileVirtualMachineGPU[]; +} + +export function hardwareProfileUpdateSerializer(item: HardwareProfileUpdate): any { + return { + vmSize: item["vmSize"], + processors: item["processors"], + memoryMB: item["memoryMB"], + virtualMachineGPUs: !item["virtualMachineGPUs"] + ? item["virtualMachineGPUs"] + : virtualMachineInstancePropertiesHardwareProfileVirtualMachineGPUArraySerializer( + item["virtualMachineGPUs"], + ), + }; +} + +/** Storage profile update */ +export interface StorageProfileUpdate { + /** adds data disks to the virtual machine instance for the update call */ + dataDisks?: VirtualHardDiskArmReference[]; +} + +export function storageProfileUpdateSerializer(item: StorageProfileUpdate): any { + return { + dataDisks: !item["dataDisks"] + ? item["dataDisks"] + : virtualHardDiskArmReferenceArraySerializer(item["dataDisks"]), + }; +} + +/** NetworkProfile - describes the network update configuration the virtual machine instance */ +export interface NetworkProfileUpdate { + /** NetworkInterfaces - list of network interfaces to be attached to the virtual machine instance */ + networkInterfaces?: NetworkInterfaceArmReference[]; +} + +export function networkProfileUpdateSerializer(item: NetworkProfileUpdate): any { + return { + networkInterfaces: !item["networkInterfaces"] + ? item["networkInterfaces"] + : networkInterfaceArmReferenceArraySerializer(item["networkInterfaces"]), + }; +} + +/** OsProfile - describes the update configuration of the operating system */ +export interface OsProfileUpdate { + /** ComputerName - name of the computer */ + computerName?: string; + /** Linux configuration properties */ + linuxConfiguration?: OsProfileUpdateLinuxConfiguration; + /** Windows configuration properties */ + windowsConfiguration?: OsProfileUpdateWindowsConfiguration; +} + +export function osProfileUpdateSerializer(item: OsProfileUpdate): any { + return { + computerName: item["computerName"], + linuxConfiguration: !item["linuxConfiguration"] + ? item["linuxConfiguration"] + : osProfileUpdateLinuxConfigurationSerializer(item["linuxConfiguration"]), + windowsConfiguration: !item["windowsConfiguration"] + ? item["windowsConfiguration"] + : osProfileUpdateWindowsConfigurationSerializer(item["windowsConfiguration"]), + }; +} + +/** OSProfile update linux configuration */ +export interface OsProfileUpdateLinuxConfiguration { + /** Used to indicate whether Arc for Servers agent onboarding should be triggered during the virtual machine instance creation process. */ + provisionVMAgent?: boolean; + /** Used to indicate whether the VM Config Agent should be installed during the virtual machine creation process. */ + provisionVMConfigAgent?: boolean; +} + +export function osProfileUpdateLinuxConfigurationSerializer( + item: OsProfileUpdateLinuxConfiguration, +): any { + return { + provisionVMAgent: item["provisionVMAgent"], + provisionVMConfigAgent: item["provisionVMConfigAgent"], + }; +} + +/** OSProfile update windows configuration */ +export interface OsProfileUpdateWindowsConfiguration { + /** Used to indicate whether Arc for Servers agent onboarding should be triggered during the virtual machine instance creation process. */ + provisionVMAgent?: boolean; + /** Used to indicate whether the VM Config Agent should be installed during the virtual machine creation process. */ + provisionVMConfigAgent?: boolean; +} + +export function osProfileUpdateWindowsConfigurationSerializer( + item: OsProfileUpdateWindowsConfiguration, +): any { + return { + provisionVMAgent: item["provisionVMAgent"], + provisionVMConfigAgent: item["provisionVMConfigAgent"], + }; +} + +/** Identity for the resource. */ +export interface Identity { + /** The principal ID of resource identity. The value must be an UUID. */ + readonly principalId?: string; + /** The tenant ID of resource. The value must be an UUID. */ + readonly tenantId?: string; + /** The identity type. */ + type?: "SystemAssigned"; +} + +export function identitySerializer(item: Identity): any { + return { type: item["type"] }; +} + +export function identityDeserializer(item: any): Identity { + return { + principalId: item["principalId"], + tenantId: item["tenantId"], + type: item["type"], + }; +} + +/** The response of a VirtualMachineInstance list operation. */ +export interface _VirtualMachineInstanceListResult { + /** The VirtualMachineInstance items on this page */ + value: VirtualMachineInstance[]; + /** The link to the next page of items */ + nextLink?: string; +} + +export function _virtualMachineInstanceListResultDeserializer( + item: any, +): _VirtualMachineInstanceListResult { + return { + value: virtualMachineInstanceArrayDeserializer(item["value"]), + nextLink: item["nextLink"], + }; +} + +export function virtualMachineInstanceArraySerializer( + result: Array, +): any[] { + return result.map((item) => { + return virtualMachineInstanceSerializer(item); + }); +} + +export function virtualMachineInstanceArrayDeserializer( + result: Array, +): any[] { + return result.map((item) => { + return virtualMachineInstanceDeserializer(item); + }); +} + +/** Defines the HybridIdentityMetadata. */ +export interface HybridIdentityMetadata extends ProxyResource { + /** The resource-specific properties for this resource. */ + properties?: HybridIdentityMetadataProperties; +} + +export function hybridIdentityMetadataDeserializer(item: any): HybridIdentityMetadata { + return { + id: item["id"], + name: item["name"], + type: item["type"], + systemData: !item["systemData"] + ? item["systemData"] + : systemDataDeserializer(item["systemData"]), + properties: !item["properties"] + ? item["properties"] + : hybridIdentityMetadataPropertiesDeserializer(item["properties"]), + }; +} + +/** Defines the resource properties. */ +export interface HybridIdentityMetadataProperties { + /** The unique identifier for the resource. */ + resourceUid?: string; + /** The Public Key. */ + publicKey?: string; + /** Identity for the resource. */ + readonly identity?: Identity; + /** Provisioning state of the virtual machine instance. */ + readonly provisioningState?: ProvisioningStateEnum; +} + +export function hybridIdentityMetadataPropertiesDeserializer( + item: any, +): HybridIdentityMetadataProperties { + return { + resourceUid: item["resourceUid"], + publicKey: item["publicKey"], + identity: !item["identity"] ? item["identity"] : identityDeserializer(item["identity"]), + provisioningState: item["provisioningState"], + }; +} + +/** The response of a HybridIdentityMetadata list operation. */ +export interface _HybridIdentityMetadataListResult { + /** The HybridIdentityMetadata items on this page */ + value: HybridIdentityMetadata[]; + /** The link to the next page of items */ + nextLink?: string; +} + +export function _hybridIdentityMetadataListResultDeserializer( + item: any, +): _HybridIdentityMetadataListResult { + return { + value: hybridIdentityMetadataArrayDeserializer(item["value"]), + nextLink: item["nextLink"], + }; +} + +export function hybridIdentityMetadataArrayDeserializer( + result: Array, +): any[] { + return result.map((item) => { + return hybridIdentityMetadataDeserializer(item); + }); +} + +/** The attestation status of the virtual machine */ +export interface AttestationStatus extends ProxyResource { + /** The resource-specific properties for this resource. */ + properties?: AttestationStatusProperties; +} + +export function attestationStatusDeserializer(item: any): AttestationStatus { + return { + id: item["id"], + name: item["name"], + type: item["type"], + systemData: !item["systemData"] + ? item["systemData"] + : systemDataDeserializer(item["systemData"]), + properties: !item["properties"] + ? item["properties"] + : attestationStatusPropertiesDeserializer(item["properties"]), + }; +} + +/** Defines the attestation status properties */ +export interface AttestationStatusProperties { + /** The status of whether secure boot is enabled. */ + readonly attestSecureBootEnabled?: AttestSecureBootPropertyEnum; + /** The status of whether attestation certificate is validated. */ + readonly attestationCertValidated?: AttestCertPropertyEnum; + /** The status of whether the list of boot integrity properties is validated. */ + readonly bootIntegrityValidated?: AttestBootIntegrityPropertyEnum; + /** kernel version string for Linux VM. */ + readonly linuxKernelVersion?: string; + /** The health status of attestation validation and parsing */ + readonly healthStatus?: AttestHealthStatusEnum; + /** The time stamp of the last time attestation token is validated by relying party service. */ + readonly timestamp?: string; + /** The error message of attestation validation and parsing */ + readonly errorMessage?: string; + /** Provisioning state of the virtual machine instance. */ + readonly provisioningState?: ProvisioningStateEnum; + /** The hardware platform information from attestation token. This only applies to Confidential VM. */ + readonly attestHardwarePlatform?: AttestHWPlatformEnum; + /** The managed disk security encryption type from attestation token. This only applies to Confidential VM. */ + readonly attestDiskSecurityEncryptionType?: AttestDiskSecurityEncryptionTypeEnum; +} + +export function attestationStatusPropertiesDeserializer(item: any): AttestationStatusProperties { + return { + attestSecureBootEnabled: item["attestSecureBootEnabled"], + attestationCertValidated: item["attestationCertValidated"], + bootIntegrityValidated: item["bootIntegrityValidated"], + linuxKernelVersion: item["linuxKernelVersion"], + healthStatus: item["healthStatus"], + timestamp: item["timestamp"], + errorMessage: item["errorMessage"], + provisioningState: item["provisioningState"], + attestHardwarePlatform: item["attestHardwarePlatform"], + attestDiskSecurityEncryptionType: item["attestDiskSecurityEncryptionType"], + }; +} + +/** The status of whether secure boot is enabled. */ +export enum KnownAttestSecureBootPropertyEnum { + /** Secure boot enabled */ + Enabled = "Enabled", + /** Secure boot disabled */ + Disabled = "Disabled", + /** Secure boot status is unknown */ + Unknown = "Unknown", +} + +/** + * The status of whether secure boot is enabled. \ + * {@link KnownAttestSecureBootPropertyEnum} can be used interchangeably with AttestSecureBootPropertyEnum, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Enabled**: Secure boot enabled \ + * **Disabled**: Secure boot disabled \ + * **Unknown**: Secure boot status is unknown + */ +export type AttestSecureBootPropertyEnum = string; + +/** The status of whether attestation certificate is validated. */ +export enum KnownAttestCertPropertyEnum { + /** Attestation certificate is valid */ + Valid = "Valid", + /** Attestation certificate is invalid */ + Invalid = "Invalid", + /** Attestation certificate status is unknown */ + Unknown = "Unknown", +} + +/** + * The status of whether attestation certificate is validated. \ + * {@link KnownAttestCertPropertyEnum} can be used interchangeably with AttestCertPropertyEnum, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Valid**: Attestation certificate is valid \ + * **Invalid**: Attestation certificate is invalid \ + * **Unknown**: Attestation certificate status is unknown + */ +export type AttestCertPropertyEnum = string; + +/** The status of whether the list of boot integrity properties is validated. */ +export enum KnownAttestBootIntegrityPropertyEnum { + /** Boot integrity properties are valid */ + Valid = "Valid", + /** Boot integrity properties are invalid */ + Invalid = "Invalid", + /** Boot integrity properties status is unknown */ + Unknown = "Unknown", +} + +/** + * The status of whether the list of boot integrity properties is validated. \ + * {@link KnownAttestBootIntegrityPropertyEnum} can be used interchangeably with AttestBootIntegrityPropertyEnum, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Valid**: Boot integrity properties are valid \ + * **Invalid**: Boot integrity properties are invalid \ + * **Unknown**: Boot integrity properties status is unknown + */ +export type AttestBootIntegrityPropertyEnum = string; + +/** The health status of attestation validation and parsing */ +export enum KnownAttestHealthStatusEnum { + /** Attestation validation and parsing pending */ + Pending = "Pending", + /** Attestation validation and parsing healthy */ + Healthy = "Healthy", + /** Attestation validation and parsing unhealthy */ + Unhealthy = "Unhealthy", + /** Attestation validation and parsing status is unknown */ + Unknown = "Unknown", +} + +/** + * The health status of attestation validation and parsing \ + * {@link KnownAttestHealthStatusEnum} can be used interchangeably with AttestHealthStatusEnum, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Pending**: Attestation validation and parsing pending \ + * **Healthy**: Attestation validation and parsing healthy \ + * **Unhealthy**: Attestation validation and parsing unhealthy \ + * **Unknown**: Attestation validation and parsing status is unknown + */ +export type AttestHealthStatusEnum = string; + +/** Defines type of hardware platform from attestation token. */ +export enum KnownAttestHWPlatformEnum { + /** AttestHWPlatform is Secure Encrypted Virtualization Secure Nested Paging (SEVSNP) */ + Sevsnp = "SEVSNP", + /** AttestHWPlatform is unknown */ + Unknown = "Unknown", +} + +/** + * Defines type of hardware platform from attestation token. \ + * {@link KnownAttestHWPlatformEnum} can be used interchangeably with AttestHWPlatformEnum, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **SEVSNP**: AttestHWPlatform is Secure Encrypted Virtualization Secure Nested Paging (SEVSNP) \ + * **Unknown**: AttestHWPlatform is unknown + */ +export type AttestHWPlatformEnum = string; + +/** Defines type of managed disk security encryption type from attestation token. */ +export enum KnownAttestDiskSecurityEncryptionTypeEnum { + /** Disk security encryption type is non-persisted Trusted Platform Module (TPM) */ + NonPersistedTPM = "NonPersistedTPM", + /** Disk security encryption type is unknown */ + Unknown = "Unknown", +} + +/** + * Defines type of managed disk security encryption type from attestation token. \ + * {@link KnownAttestDiskSecurityEncryptionTypeEnum} can be used interchangeably with AttestDiskSecurityEncryptionTypeEnum, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **NonPersistedTPM**: Disk security encryption type is non-persisted Trusted Platform Module (TPM) \ + * **Unknown**: Disk security encryption type is unknown + */ +export type AttestDiskSecurityEncryptionTypeEnum = string; + +/** Defines the GuestAgent. */ +export interface GuestAgent extends ProxyResource { + /** The resource-specific properties for this resource. */ + properties?: GuestAgentProperties; +} + +export function guestAgentSerializer(item: GuestAgent): any { + return { + properties: !item["properties"] + ? item["properties"] + : guestAgentPropertiesSerializer(item["properties"]), + }; +} + +export function guestAgentDeserializer(item: any): GuestAgent { + return { + id: item["id"], + name: item["name"], + type: item["type"], + systemData: !item["systemData"] + ? item["systemData"] + : systemDataDeserializer(item["systemData"]), + properties: !item["properties"] + ? item["properties"] + : guestAgentPropertiesDeserializer(item["properties"]), + }; +} + +/** Defines the resource properties. */ +export interface GuestAgentProperties { + /** Username / Password Credentials to provision guest agent. */ + credentials?: GuestCredential; + /** The guest agent provisioning action. */ + provisioningAction?: ProvisioningAction; + /** The guest agent status. */ + readonly status?: string; + /** Provisioning state of the virtual machine instance. */ + readonly provisioningState?: ProvisioningStateEnum; +} + +export function guestAgentPropertiesSerializer(item: GuestAgentProperties): any { + return { + credentials: !item["credentials"] + ? item["credentials"] + : guestCredentialSerializer(item["credentials"]), + provisioningAction: item["provisioningAction"], + }; +} + +export function guestAgentPropertiesDeserializer(item: any): GuestAgentProperties { + return { + credentials: !item["credentials"] + ? item["credentials"] + : guestCredentialDeserializer(item["credentials"]), + provisioningAction: item["provisioningAction"], + status: item["status"], + provisioningState: item["provisioningState"], + }; +} + +/** Username / Password Credentials to connect to guest. */ +export interface GuestCredential { + /** The username to connect with the guest. */ + username?: string; + /** The password to connect with the guest. */ + password?: string; +} + +export function guestCredentialSerializer(item: GuestCredential): any { + return { username: item["username"], password: item["password"] }; +} + +export function guestCredentialDeserializer(item: any): GuestCredential { + return { + username: item["username"], + password: item["password"], + }; +} + +/** Defines the different types of operations for guest agent. */ +export enum KnownProvisioningAction { + /** Install guest agent */ + Install = "install", + /** Uninstall guest agent */ + Uninstall = "uninstall", + /** Repair guest agent */ + Repair = "repair", +} + +/** + * Defines the different types of operations for guest agent. \ + * {@link KnownProvisioningAction} can be used interchangeably with ProvisioningAction, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **install**: Install guest agent \ + * **uninstall**: Uninstall guest agent \ + * **repair**: Repair guest agent + */ +export type ProvisioningAction = string; + +/** The response of a GuestAgent list operation. */ +export interface _GuestAgentListResult { + /** The GuestAgent items on this page */ + value: GuestAgent[]; + /** The link to the next page of items */ + nextLink?: string; +} + +export function _guestAgentListResultDeserializer(item: any): _GuestAgentListResult { + return { + value: guestAgentArrayDeserializer(item["value"]), + nextLink: item["nextLink"], + }; +} + +export function guestAgentArraySerializer(result: Array): any[] { + return result.map((item) => { + return guestAgentSerializer(item); + }); +} + +export function guestAgentArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return guestAgentDeserializer(item); + }); +} + +/** The available API versions. */ +export enum KnownVersions { + /** The 2024-02-01-preview API version. */ + V20240201Preview = "2024-02-01-preview", + /** The 2024-05-01-preview API version. */ + V20240501Preview = "2024-05-01-preview", + /** The 2024-08-01-preview API version. */ + V20240801Preview = "2024-08-01-preview", + /** The 2024-10-01-preview API version. */ + V20241001Preview = "2024-10-01-preview", + /** The 2025-02-01-preview API version. */ + V20250201Preview = "2025-02-01-preview", + /** The 2025-04-01-preview API version. */ + V20250401Preview = "2025-04-01-preview", + /** The 2025-06-01-preview API version. */ + V20250601Preview = "2025-06-01-preview", +} diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/src/restorePollerHelpers.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/src/restorePollerHelpers.ts new file mode 100644 index 000000000000..60dcd5176357 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/src/restorePollerHelpers.ts @@ -0,0 +1,355 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { AzureStackHCIVMManagementClient } from "./azureStackHcivmManagementClient.js"; +import { _$deleteDeserialize, _createDeserialize } from "./api/guestAgents/operations.js"; +import { + _saveDeserialize, + _pauseDeserialize, + _restartDeserialize, + _stopDeserialize, + _startDeserialize, + _$deleteDeserialize as _$deleteDeserializeVirtualMachineInstances, + _updateDeserialize, + _createOrUpdateDeserialize, +} from "./api/virtualMachineInstances/operations.js"; +import { + _uploadDeserialize, + _$deleteDeserialize as _$deleteDeserializeVirtualHardDisks, + _updateDeserialize as _updateDeserializeVirtualHardDisks, + _createOrUpdateDeserialize as _createOrUpdateDeserializeVirtualHardDisks, +} from "./api/virtualHardDisks/operations.js"; +import { + _$deleteDeserialize as _$deleteDeserializeStorageContainers, + _updateDeserialize as _updateDeserializeStorageContainers, + _createOrUpdateDeserialize as _createOrUpdateDeserializeStorageContainers, +} from "./api/storageContainers/operations.js"; +import { + _$deleteDeserialize as _$deleteDeserializeSecurityRules, + _createOrUpdateDeserialize as _createOrUpdateDeserializeSecurityRules, +} from "./api/securityRules/operations.js"; +import { + _$deleteDeserialize as _$deleteDeserializeNetworkSecurityGroups, + _updateTagsDeserialize, + _createOrUpdateDeserialize as _createOrUpdateDeserializeNetworkSecurityGroups, +} from "./api/networkSecurityGroups/operations.js"; +import { + _$deleteDeserialize as _$deleteDeserializeNetworkInterfaces, + _updateDeserialize as _updateDeserializeNetworkInterfaces, + _createOrUpdateDeserialize as _createOrUpdateDeserializeNetworkInterfaces, +} from "./api/networkInterfaces/operations.js"; +import { + _$deleteDeserialize as _$deleteDeserializeMarketplaceGalleryImages, + _updateDeserialize as _updateDeserializeMarketplaceGalleryImages, + _createOrUpdateDeserialize as _createOrUpdateDeserializeMarketplaceGalleryImages, +} from "./api/marketplaceGalleryImages/operations.js"; +import { + _$deleteDeserialize as _$deleteDeserializeLogicalNetworks, + _updateDeserialize as _updateDeserializeLogicalNetworks, + _createOrUpdateDeserialize as _createOrUpdateDeserializeLogicalNetworks, +} from "./api/logicalNetworks/operations.js"; +import { + _$deleteDeserialize as _$deleteDeserializeGalleryImages, + _updateDeserialize as _updateDeserializeGalleryImages, + _createOrUpdateDeserialize as _createOrUpdateDeserializeGalleryImages, +} from "./api/galleryImages/operations.js"; +import { getLongRunningPoller } from "./static-helpers/pollingHelpers.js"; +import { OperationOptions, PathUncheckedResponse } from "@azure-rest/core-client"; +import { AbortSignalLike } from "@azure/abort-controller"; +import { + PollerLike, + OperationState, + deserializeState, + ResourceLocationConfig, +} from "@azure/core-lro"; + +export interface RestorePollerOptions< + TResult, + TResponse extends PathUncheckedResponse = PathUncheckedResponse, +> extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** + * The signal which can be used to abort requests. + */ + abortSignal?: AbortSignalLike; + /** Deserialization function for raw response body */ + processResponseBody?: (result: TResponse) => Promise; +} + +/** + * Creates a poller from the serialized state of another poller. This can be + * useful when you want to create pollers on a different host or a poller + * needs to be constructed after the original one is not in scope. + */ +export function restorePoller( + client: AzureStackHCIVMManagementClient, + serializedState: string, + sourceOperation: (...args: any[]) => PollerLike, TResult>, + options?: RestorePollerOptions, +): PollerLike, TResult> { + const pollerConfig = deserializeState(serializedState).config; + const { initialRequestUrl, requestMethod, metadata } = pollerConfig; + if (!initialRequestUrl || !requestMethod) { + throw new Error( + `Invalid serialized state: ${serializedState} for sourceOperation ${sourceOperation?.name}`, + ); + } + const resourceLocationConfig = metadata?.["resourceLocationConfig"] as + | ResourceLocationConfig + | undefined; + const { deserializer, expectedStatuses = [] } = + getDeserializationHelper(initialRequestUrl, requestMethod) ?? {}; + const deserializeHelper = options?.processResponseBody ?? deserializer; + if (!deserializeHelper) { + throw new Error( + `Please ensure the operation is in this client! We can't find its deserializeHelper for ${sourceOperation?.name}.`, + ); + } + return getLongRunningPoller( + (client as any)["_client"] ?? client, + deserializeHelper as (result: TResponse) => Promise, + expectedStatuses, + { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + resourceLocationConfig, + restoreFrom: serializedState, + initialRequestUrl, + }, + ); +} + +interface DeserializationHelper { + deserializer: Function; + expectedStatuses: string[]; +} + +const deserializeMap: Record = { + "DELETE /{resourceUri}/providers/Microsoft.AzureStackHCI/virtualMachineInstances/default/guestAgents/default": + { + deserializer: _$deleteDeserialize, + expectedStatuses: ["202", "204", "200"], + }, + "PUT /{resourceUri}/providers/Microsoft.AzureStackHCI/virtualMachineInstances/default/guestAgents/default": + { + deserializer: _createDeserialize, + expectedStatuses: ["200", "201", "202"], + }, + "POST /{resourceUri}/providers/Microsoft.AzureStackHCI/virtualMachineInstances/default/save": { + deserializer: _saveDeserialize, + expectedStatuses: ["202", "200"], + }, + "POST /{resourceUri}/providers/Microsoft.AzureStackHCI/virtualMachineInstances/default/pause": { + deserializer: _pauseDeserialize, + expectedStatuses: ["202", "200"], + }, + "POST /{resourceUri}/providers/Microsoft.AzureStackHCI/virtualMachineInstances/default/restart": { + deserializer: _restartDeserialize, + expectedStatuses: ["202", "200"], + }, + "POST /{resourceUri}/providers/Microsoft.AzureStackHCI/virtualMachineInstances/default/stop": { + deserializer: _stopDeserialize, + expectedStatuses: ["202", "200"], + }, + "POST /{resourceUri}/providers/Microsoft.AzureStackHCI/virtualMachineInstances/default/start": { + deserializer: _startDeserialize, + expectedStatuses: ["202", "200"], + }, + "DELETE /{resourceUri}/providers/Microsoft.AzureStackHCI/virtualMachineInstances/default": { + deserializer: _$deleteDeserializeVirtualMachineInstances, + expectedStatuses: ["202", "204", "200"], + }, + "PATCH /{resourceUri}/providers/Microsoft.AzureStackHCI/virtualMachineInstances/default": { + deserializer: _updateDeserialize, + expectedStatuses: ["200", "202"], + }, + "PUT /{resourceUri}/providers/Microsoft.AzureStackHCI/virtualMachineInstances/default": { + deserializer: _createOrUpdateDeserialize, + expectedStatuses: ["200", "201", "202"], + }, + "POST /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/virtualHardDisks/{virtualHardDiskName}/upload": + { deserializer: _uploadDeserialize, expectedStatuses: ["202", "200"] }, + "DELETE /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/virtualHardDisks/{virtualHardDiskName}": + { + deserializer: _$deleteDeserializeVirtualHardDisks, + expectedStatuses: ["202", "204", "200"], + }, + "PATCH /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/virtualHardDisks/{virtualHardDiskName}": + { + deserializer: _updateDeserializeVirtualHardDisks, + expectedStatuses: ["200", "202"], + }, + "PUT /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/virtualHardDisks/{virtualHardDiskName}": + { + deserializer: _createOrUpdateDeserializeVirtualHardDisks, + expectedStatuses: ["200", "201", "202"], + }, + "DELETE /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/storageContainers/{storageContainerName}": + { + deserializer: _$deleteDeserializeStorageContainers, + expectedStatuses: ["202", "204", "200"], + }, + "PATCH /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/storageContainers/{storageContainerName}": + { + deserializer: _updateDeserializeStorageContainers, + expectedStatuses: ["200", "202"], + }, + "PUT /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/storageContainers/{storageContainerName}": + { + deserializer: _createOrUpdateDeserializeStorageContainers, + expectedStatuses: ["200", "201", "202"], + }, + "DELETE /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}": + { + deserializer: _$deleteDeserializeSecurityRules, + expectedStatuses: ["202", "204", "200"], + }, + "PUT /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}": + { + deserializer: _createOrUpdateDeserializeSecurityRules, + expectedStatuses: ["200", "201", "202"], + }, + "DELETE /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/networkSecurityGroups/{networkSecurityGroupName}": + { + deserializer: _$deleteDeserializeNetworkSecurityGroups, + expectedStatuses: ["202", "204", "200"], + }, + "PATCH /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/networkSecurityGroups/{networkSecurityGroupName}": + { deserializer: _updateTagsDeserialize, expectedStatuses: ["200", "202"] }, + "PUT /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/networkSecurityGroups/{networkSecurityGroupName}": + { + deserializer: _createOrUpdateDeserializeNetworkSecurityGroups, + expectedStatuses: ["200", "201", "202"], + }, + "DELETE /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/networkInterfaces/{networkInterfaceName}": + { + deserializer: _$deleteDeserializeNetworkInterfaces, + expectedStatuses: ["202", "204", "200"], + }, + "PATCH /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/networkInterfaces/{networkInterfaceName}": + { + deserializer: _updateDeserializeNetworkInterfaces, + expectedStatuses: ["200", "202"], + }, + "PUT /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/networkInterfaces/{networkInterfaceName}": + { + deserializer: _createOrUpdateDeserializeNetworkInterfaces, + expectedStatuses: ["200", "201", "202"], + }, + "DELETE /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/marketplaceGalleryImages/{marketplaceGalleryImageName}": + { + deserializer: _$deleteDeserializeMarketplaceGalleryImages, + expectedStatuses: ["202", "204", "200"], + }, + "PATCH /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/marketplaceGalleryImages/{marketplaceGalleryImageName}": + { + deserializer: _updateDeserializeMarketplaceGalleryImages, + expectedStatuses: ["200", "202"], + }, + "PUT /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/marketplaceGalleryImages/{marketplaceGalleryImageName}": + { + deserializer: _createOrUpdateDeserializeMarketplaceGalleryImages, + expectedStatuses: ["200", "201", "202"], + }, + "DELETE /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/logicalNetworks/{logicalNetworkName}": + { + deserializer: _$deleteDeserializeLogicalNetworks, + expectedStatuses: ["202", "204", "200"], + }, + "PATCH /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/logicalNetworks/{logicalNetworkName}": + { + deserializer: _updateDeserializeLogicalNetworks, + expectedStatuses: ["200", "202"], + }, + "PUT /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/logicalNetworks/{logicalNetworkName}": + { + deserializer: _createOrUpdateDeserializeLogicalNetworks, + expectedStatuses: ["200", "201", "202"], + }, + "DELETE /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/galleryImages/{galleryImageName}": + { + deserializer: _$deleteDeserializeGalleryImages, + expectedStatuses: ["202", "204", "200"], + }, + "PATCH /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/galleryImages/{galleryImageName}": + { + deserializer: _updateDeserializeGalleryImages, + expectedStatuses: ["200", "202"], + }, + "PUT /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/galleryImages/{galleryImageName}": + { + deserializer: _createOrUpdateDeserializeGalleryImages, + expectedStatuses: ["200", "201", "202"], + }, +}; + +function getDeserializationHelper( + urlStr: string, + method: string, +): DeserializationHelper | undefined { + const path = new URL(urlStr).pathname; + const pathParts = path.split("/"); + + // Traverse list to match the longest candidate + // matchedLen: the length of candidate path + // matchedValue: the matched status code array + let matchedLen = -1, + matchedValue: DeserializationHelper | undefined; + + // Iterate the responseMap to find a match + for (const [key, value] of Object.entries(deserializeMap)) { + // Extracting the path from the map key which is in format + // GET /path/foo + if (!key.startsWith(method)) { + continue; + } + const candidatePath = getPathFromMapKey(key); + // Get each part of the url path + const candidateParts = candidatePath.split("/"); + + // track if we have found a match to return the values found. + let found = true; + for (let i = candidateParts.length - 1, j = pathParts.length - 1; i >= 1 && j >= 1; i--, j--) { + if (candidateParts[i]?.startsWith("{") && candidateParts[i]?.indexOf("}") !== -1) { + const start = candidateParts[i]!.indexOf("}") + 1, + end = candidateParts[i]?.length; + // If the current part of the candidate is a "template" part + // Try to use the suffix of pattern to match the path + // {guid} ==> $ + // {guid}:export ==> :export$ + const isMatched = new RegExp(`${candidateParts[i]?.slice(start, end)}`).test( + pathParts[j] || "", + ); + + if (!isMatched) { + found = false; + break; + } + continue; + } + + // If the candidate part is not a template and + // the parts don't match mark the candidate as not found + // to move on with the next candidate path. + if (candidateParts[i] !== pathParts[j]) { + found = false; + break; + } + } + + // We finished evaluating the current candidate parts + // Update the matched value if and only if we found the longer pattern + if (found && candidatePath.length > matchedLen) { + matchedLen = candidatePath.length; + matchedValue = value; + } + } + + return matchedValue; +} + +function getPathFromMapKey(mapKey: string): string { + const pathStart = mapKey.indexOf("/"); + return mapKey.slice(pathStart); +} diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/src/static-helpers/cloudSettingHelpers.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/src/static-helpers/cloudSettingHelpers.ts new file mode 100644 index 000000000000..e4034348f1fa --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/src/static-helpers/cloudSettingHelpers.ts @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +/** An enum to describe Azure Cloud. */ +export enum AzureClouds { + /** Azure public cloud, which is the default cloud for Azure SDKs. */ + AZURE_PUBLIC_CLOUD = "AZURE_PUBLIC_CLOUD", + /** Azure China cloud */ + AZURE_CHINA_CLOUD = "AZURE_CHINA_CLOUD", + /** Azure US government cloud */ + AZURE_US_GOVERNMENT = "AZURE_US_GOVERNMENT", +} + +/** The supported values for cloud setting as a string literal type */ +export type AzureSupportedClouds = `${AzureClouds}`; + +export function getArmEndpoint(cloudSetting?: AzureSupportedClouds): string | undefined { + if (cloudSetting === undefined) { + return undefined; + } + const cloudEndpoints: Record = { + AZURE_CHINA_CLOUD: "https://management.chinacloudapi.cn/", + AZURE_US_GOVERNMENT: "https://management.usgovcloudapi.net/", + AZURE_PUBLIC_CLOUD: "https://management.azure.com/", + }; + if (cloudSetting in cloudEndpoints) { + return cloudEndpoints[cloudSetting]; + } else { + throw new Error( + `Unknown cloud setting: ${cloudSetting}. Please refer to the enum AzureClouds for possible values.`, + ); + } +} diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/src/static-helpers/pagingHelpers.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/src/static-helpers/pagingHelpers.ts new file mode 100644 index 000000000000..ce33af5f4178 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/src/static-helpers/pagingHelpers.ts @@ -0,0 +1,241 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { Client, createRestError, PathUncheckedResponse } from "@azure-rest/core-client"; +import { RestError } from "@azure/core-rest-pipeline"; + +/** + * Options for the byPage method + */ +export interface PageSettings { + /** + * A reference to a specific page to start iterating from. + */ + continuationToken?: string; +} + +/** + * An interface that describes a page of results. + */ +export type ContinuablePage = TPage & { + /** + * The token that keeps track of where to continue the iterator + */ + continuationToken?: string; +}; + +/** + * An interface that allows async iterable iteration both to completion and by page. + */ +export interface PagedAsyncIterableIterator< + TElement, + TPage = TElement[], + TPageSettings extends PageSettings = PageSettings, +> { + /** + * The next method, part of the iteration protocol + */ + next(): Promise>; + /** + * The connection to the async iterator, part of the iteration protocol + */ + [Symbol.asyncIterator](): PagedAsyncIterableIterator; + /** + * Return an AsyncIterableIterator that works a page at a time + */ + byPage: (settings?: TPageSettings) => AsyncIterableIterator>; +} + +/** + * An interface that describes how to communicate with the service. + */ +export interface PagedResult< + TElement, + TPage = TElement[], + TPageSettings extends PageSettings = PageSettings, +> { + /** + * Link to the first page of results. + */ + firstPageLink?: string; + /** + * A method that returns a page of results. + */ + getPage: (pageLink?: string) => Promise<{ page: TPage; nextPageLink?: string } | undefined>; + /** + * a function to implement the `byPage` method on the paged async iterator. + */ + byPage?: (settings?: TPageSettings) => AsyncIterableIterator>; + + /** + * A function to extract elements from a page. + */ + toElements?: (page: TPage) => TElement[]; +} + +/** + * Options for the paging helper + */ +export interface BuildPagedAsyncIteratorOptions { + itemName?: string; + nextLinkName?: string; +} + +/** + * Helper to paginate results in a generic way and return a PagedAsyncIterableIterator + */ +export function buildPagedAsyncIterator< + TElement, + TPage = TElement[], + TPageSettings extends PageSettings = PageSettings, + TResponse extends PathUncheckedResponse = PathUncheckedResponse, +>( + client: Client, + getInitialResponse: () => PromiseLike, + processResponseBody: (result: TResponse) => PromiseLike, + expectedStatuses: string[], + options: BuildPagedAsyncIteratorOptions = {}, +): PagedAsyncIterableIterator { + const itemName = options.itemName ?? "value"; + const nextLinkName = options.nextLinkName ?? "nextLink"; + const pagedResult: PagedResult = { + getPage: async (pageLink?: string) => { + const result = + pageLink === undefined + ? await getInitialResponse() + : await client.pathUnchecked(pageLink).get(); + checkPagingRequest(result, expectedStatuses); + const results = await processResponseBody(result as TResponse); + const nextLink = getNextLink(results, nextLinkName); + const values = getElements(results, itemName) as TPage; + return { + page: values, + nextPageLink: nextLink, + }; + }, + byPage: (settings?: TPageSettings) => { + const { continuationToken } = settings ?? {}; + return getPageAsyncIterator(pagedResult, { + pageLink: continuationToken, + }); + }, + }; + return getPagedAsyncIterator(pagedResult); +} + +/** + * returns an async iterator that iterates over results. It also has a `byPage` + * method that returns pages of items at once. + * + * @param pagedResult - an object that specifies how to get pages. + * @returns a paged async iterator that iterates over results. + */ + +function getPagedAsyncIterator< + TElement, + TPage = TElement[], + TPageSettings extends PageSettings = PageSettings, +>( + pagedResult: PagedResult, +): PagedAsyncIterableIterator { + const iter = getItemAsyncIterator(pagedResult); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: + pagedResult?.byPage ?? + ((settings?: TPageSettings) => { + const { continuationToken } = settings ?? {}; + return getPageAsyncIterator(pagedResult, { + pageLink: continuationToken, + }); + }), + }; +} + +async function* getItemAsyncIterator( + pagedResult: PagedResult, +): AsyncIterableIterator { + const pages = getPageAsyncIterator(pagedResult); + for await (const page of pages) { + yield* page as unknown as TElement[]; + } +} + +async function* getPageAsyncIterator( + pagedResult: PagedResult, + options: { + pageLink?: string; + } = {}, +): AsyncIterableIterator> { + const { pageLink } = options; + let response = await pagedResult.getPage(pageLink ?? pagedResult.firstPageLink); + if (!response) { + return; + } + let result = response.page as ContinuablePage; + result.continuationToken = response.nextPageLink; + yield result; + while (response.nextPageLink) { + response = await pagedResult.getPage(response.nextPageLink); + if (!response) { + return; + } + result = response.page as ContinuablePage; + result.continuationToken = response.nextPageLink; + yield result; + } +} + +/** + * Gets for the value of nextLink in the body + */ +function getNextLink(body: unknown, nextLinkName?: string): string | undefined { + if (!nextLinkName) { + return undefined; + } + + const nextLink = (body as Record)[nextLinkName]; + + if (typeof nextLink !== "string" && typeof nextLink !== "undefined" && nextLink !== null) { + throw new RestError( + `Body Property ${nextLinkName} should be a string or undefined or null but got ${typeof nextLink}`, + ); + } + + if (nextLink === null) { + return undefined; + } + + return nextLink; +} + +/** + * Gets the elements of the current request in the body. + */ +function getElements(body: unknown, itemName: string): T[] { + const value = (body as Record)[itemName] as T[]; + if (!Array.isArray(value)) { + throw new RestError( + `Couldn't paginate response\n Body doesn't contain an array property with name: ${itemName}`, + ); + } + + return value ?? []; +} + +/** + * Checks if a request failed + */ +function checkPagingRequest(response: PathUncheckedResponse, expectedStatuses: string[]): void { + if (!expectedStatuses.includes(response.status)) { + throw createRestError( + `Pagination failed with unexpected statusCode ${response.status}`, + response, + ); + } +} diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/src/static-helpers/pollingHelpers.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/src/static-helpers/pollingHelpers.ts new file mode 100644 index 000000000000..f01c41bab69d --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/src/static-helpers/pollingHelpers.ts @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { + PollerLike, + OperationState, + ResourceLocationConfig, + RunningOperation, + createHttpPoller, + OperationResponse, +} from "@azure/core-lro"; + +import { Client, PathUncheckedResponse, createRestError } from "@azure-rest/core-client"; +import { AbortSignalLike } from "@azure/abort-controller"; + +export interface GetLongRunningPollerOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** + * The signal which can be used to abort requests. + */ + abortSignal?: AbortSignalLike; + /** + * The potential location of the result of the LRO if specified by the LRO extension in the swagger. + */ + resourceLocationConfig?: ResourceLocationConfig; + /** + * The original url of the LRO + * Should not be null when restoreFrom is set + */ + initialRequestUrl?: string; + /** + * A serialized poller which can be used to resume an existing paused Long-Running-Operation. + */ + restoreFrom?: string; + /** + * The function to get the initial response + */ + getInitialResponse?: () => PromiseLike; +} +export function getLongRunningPoller( + client: Client, + processResponseBody: (result: TResponse) => Promise, + expectedStatuses: string[], + options: GetLongRunningPollerOptions, +): PollerLike, TResult> { + const { restoreFrom, getInitialResponse } = options; + if (!restoreFrom && !getInitialResponse) { + throw new Error("Either restoreFrom or getInitialResponse must be specified"); + } + let initialResponse: TResponse | undefined = undefined; + const pollAbortController = new AbortController(); + const poller: RunningOperation = { + sendInitialRequest: async () => { + if (!getInitialResponse) { + throw new Error("getInitialResponse is required when initializing a new poller"); + } + initialResponse = await getInitialResponse(); + return getLroResponse(initialResponse, expectedStatuses); + }, + sendPollRequest: async ( + path: string, + pollOptions?: { + abortSignal?: AbortSignalLike; + }, + ) => { + // The poll request would both listen to the user provided abort signal and the poller's own abort signal + function abortListener(): void { + pollAbortController.abort(); + } + const abortSignal = pollAbortController.signal; + if (options.abortSignal?.aborted) { + pollAbortController.abort(); + } else if (pollOptions?.abortSignal?.aborted) { + pollAbortController.abort(); + } else if (!abortSignal.aborted) { + options.abortSignal?.addEventListener("abort", abortListener, { + once: true, + }); + pollOptions?.abortSignal?.addEventListener("abort", abortListener, { + once: true, + }); + } + let response; + try { + response = await client.pathUnchecked(path).get({ abortSignal }); + } finally { + options.abortSignal?.removeEventListener("abort", abortListener); + pollOptions?.abortSignal?.removeEventListener("abort", abortListener); + } + + return getLroResponse(response as TResponse, expectedStatuses); + }, + }; + return createHttpPoller(poller, { + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: options?.resourceLocationConfig, + restoreFrom: options?.restoreFrom, + processResult: (result: unknown) => { + return processResponseBody(result as TResponse); + }, + }); +} +/** + * Converts a Rest Client response to a response that the LRO implementation understands + * @param response - a rest client http response + * @param deserializeFn - deserialize function to convert Rest response to modular output + * @returns - An LRO response that the LRO implementation understands + */ +function getLroResponse( + response: TResponse, + expectedStatuses: string[], +): OperationResponse { + if (!expectedStatuses.includes(response.status)) { + throw createRestError(response); + } + + return { + flatResponse: response, + rawResponse: { + ...response, + statusCode: Number.parseInt(response.status), + body: response.body, + }, + }; +} diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/src/static-helpers/urlTemplate.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/src/static-helpers/urlTemplate.ts new file mode 100644 index 000000000000..5a7b94d2adc0 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/src/static-helpers/urlTemplate.ts @@ -0,0 +1,198 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +//--------------------- +// interfaces +//--------------------- +interface ValueOptions { + isFirst: boolean; // is first value in the expression + op?: string; // operator + varValue?: any; // variable value + varName?: string; // variable name + modifier?: string; // modifier e.g * + reserved?: boolean; // if true we'll keep reserved words with not encoding +} + +export interface UrlTemplateOptions { + // if set to true, reserved characters will not be encoded + allowReserved?: boolean; +} + +// --------------------- +// helpers +// --------------------- +function encodeComponent(val: string, reserved?: boolean, op?: string) { + return (reserved ?? op === "+") || op === "#" + ? encodeReservedComponent(val) + : encodeRFC3986URIComponent(val); +} + +function encodeReservedComponent(str: string) { + return str + .split(/(%[0-9A-Fa-f]{2})/g) + .map((part) => (!/%[0-9A-Fa-f]/.test(part) ? encodeURI(part) : part)) + .join(""); +} + +function encodeRFC3986URIComponent(str: string) { + return encodeURIComponent(str).replace( + /[!'()*]/g, + (c) => `%${c.charCodeAt(0).toString(16).toUpperCase()}`, + ); +} + +function isDefined(val: any) { + return val !== undefined && val !== null; +} + +function getNamedAndIfEmpty(op?: string): [boolean, string] { + return [!!op && [";", "?", "&"].includes(op), !!op && ["?", "&"].includes(op) ? "=" : ""]; +} + +function getFirstOrSep(op?: string, isFirst = false) { + if (isFirst) { + return !op || op === "+" ? "" : op; + } else if (!op || op === "+" || op === "#") { + return ","; + } else if (op === "?") { + return "&"; + } else { + return op; + } +} + +function getExpandedValue(option: ValueOptions) { + let isFirst = option.isFirst; + const { op, varName, varValue: value, reserved } = option; + const vals: string[] = []; + const [named, ifEmpty] = getNamedAndIfEmpty(op); + + if (Array.isArray(value)) { + for (const val of value.filter(isDefined)) { + // prepare the following parts: separator, varName, value + vals.push(`${getFirstOrSep(op, isFirst)}`); + if (named && varName) { + vals.push(`${encodeURIComponent(varName)}`); + val === "" ? vals.push(ifEmpty) : vals.push("="); + } + vals.push(encodeComponent(val, reserved, op)); + isFirst = false; + } + } else if (typeof value === "object") { + for (const key of Object.keys(value)) { + const val = value[key]; + if (!isDefined(val)) { + continue; + } + // prepare the following parts: separator, key, value + vals.push(`${getFirstOrSep(op, isFirst)}`); + if (key) { + vals.push(`${encodeURIComponent(key)}`); + named && val === "" ? vals.push(ifEmpty) : vals.push("="); + } + vals.push(encodeComponent(val, reserved, op)); + isFirst = false; + } + } + return vals.join(""); +} + +function getNonExpandedValue(option: ValueOptions) { + const { op, varName, varValue: value, isFirst, reserved } = option; + const vals: string[] = []; + const first = getFirstOrSep(op, isFirst); + const [named, ifEmpty] = getNamedAndIfEmpty(op); + if (named && varName) { + vals.push(encodeComponent(varName, reserved, op)); + if (value === "") { + if (!ifEmpty) { + vals.push(ifEmpty); + } + return !vals.join("") ? undefined : `${first}${vals.join("")}`; + } + vals.push("="); + } + + const items = []; + if (Array.isArray(value)) { + for (const val of value.filter(isDefined)) { + items.push(encodeComponent(val, reserved, op)); + } + } else if (typeof value === "object") { + for (const key of Object.keys(value)) { + if (!isDefined(value[key])) { + continue; + } + items.push(encodeRFC3986URIComponent(key)); + items.push(encodeComponent(value[key], reserved, op)); + } + } + vals.push(items.join(",")); + return !vals.join(",") ? undefined : `${first}${vals.join("")}`; +} + +function getVarValue(option: ValueOptions): string | undefined { + const { op, varName, modifier, isFirst, reserved, varValue: value } = option; + + if (!isDefined(value)) { + return undefined; + } else if (["string", "number", "boolean"].includes(typeof value)) { + let val = value.toString(); + const [named, ifEmpty] = getNamedAndIfEmpty(op); + const vals: string[] = [getFirstOrSep(op, isFirst)]; + if (named && varName) { + // No need to encode varName considering it is already encoded + vals.push(varName); + val === "" ? vals.push(ifEmpty) : vals.push("="); + } + if (modifier && modifier !== "*") { + val = val.substring(0, parseInt(modifier, 10)); + } + vals.push(encodeComponent(val, reserved, op)); + return vals.join(""); + } else if (modifier === "*") { + return getExpandedValue(option); + } else { + return getNonExpandedValue(option); + } +} + +// --------------------------------------------------------------------------------------------------- +// This is an implementation of RFC 6570 URI Template: https://datatracker.ietf.org/doc/html/rfc6570. +// --------------------------------------------------------------------------------------------------- +export function expandUrlTemplate( + template: string, + context: Record, + option?: UrlTemplateOptions, +): string { + return template.replace(/\{([^\{\}]+)\}|([^\{\}]+)/g, (_, expr, text) => { + if (!expr) { + return encodeReservedComponent(text); + } + let op; + if (["+", "#", ".", "/", ";", "?", "&"].includes(expr[0])) { + op = expr[0]; + expr = expr.slice(1); + } + const varList = expr.split(/,/g); + const result = []; + for (const varSpec of varList) { + const varMatch = /([^:\*]*)(?::(\d+)|(\*))?/.exec(varSpec); + if (!varMatch || !varMatch[1]) { + continue; + } + const varValue = getVarValue({ + isFirst: result.length === 0, + op, + varValue: context[varMatch[1]], + varName: varMatch[1], + modifier: varMatch[2] || varMatch[3], + reserved: option?.allowReserved, + }); + if (varValue) { + result.push(varValue); + } + } + return result.join(""); + }); +} diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/test/public/azurestackhcivm.spec.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/test/public/azurestackhcivm.spec.ts new file mode 100644 index 000000000000..9a983ad53866 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/test/public/azurestackhcivm.spec.ts @@ -0,0 +1,46 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { env, Recorder, 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 { AzureStackHCIVMManagementClient } from "../../src/azureStackHcivmManagementClient.js"; + +export const testPollingOptions = { + updateIntervalInMs: isPlaybackMode() ? 0 : undefined, +}; + +describe("AzureStackHCIVM test", () => { + let recorder: Recorder; + let subscriptionId: string; + let client: AzureStackHCIVMManagementClient; + + 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 AzureStackHCIVMManagementClient( + credential, + subscriptionId, + recorder.configureClientOptions({}), + ); + }); + + afterEach(async function () { + await recorder.stop(); + }); + it("operations list test", async function () { + const resArray = new Array(); + for await (let item of client.galleryImages.listAll()) { + resArray.push(item); + } + assert.ok(resArray); + }); +}); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/test/public/utils/recordedClient.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/test/public/utils/recordedClient.ts new file mode 100644 index 000000000000..14dcd9fa397c --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/test/public/utils/recordedClient.ts @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { Recorder, RecorderStartOptions, VitestTestContext } from "@azure-tools/test-recorder"; + +const replaceableVariables: Record = { + SUBSCRIPTION_ID: "azure_subscription_id", +}; + +const recorderEnvSetup: RecorderStartOptions = { + envSetupForPlayback: replaceableVariables, +}; + +/** + * creates the recorder and reads the environment variables from the `.env` file. + * Should be called first in the test suite to make sure environment variables are + * read before they are being used. + */ +export async function createRecorder(context: VitestTestContext): Promise { + const recorder = new Recorder(context); + await recorder.start(recorderEnvSetup); + return recorder; +} diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/test/snippets.spec.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/test/snippets.spec.ts new file mode 100644 index 000000000000..3b70d04bebfd --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/test/snippets.spec.ts @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { AzureStackHCIVMManagementClient } 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 AzureStackHCIVMManagementClient( + new DefaultAzureCredential(), + subscriptionId, + ); + }); + + it("ReadmeSampleCreateClient_Browser", async () => { + const credential = new InteractiveBrowserCredential({ + tenantId: "", + clientId: "", + }); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new AzureStackHCIVMManagementClient(credential, subscriptionId); + }); + + it("SetLogLevel", async () => { + setLogLevel("info"); + }); +}); diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/tsconfig.browser.config.json b/sdk/azurestackhcivm/arm-azurestackhcivm/tsconfig.browser.config.json new file mode 100644 index 000000000000..75871518e3a0 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/tsconfig.browser.config.json @@ -0,0 +1,3 @@ +{ + "extends": ["./tsconfig.test.json", "../../../tsconfig.browser.base.json"] +} diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/tsconfig.json b/sdk/azurestackhcivm/arm-azurestackhcivm/tsconfig.json new file mode 100644 index 000000000000..0e57dbd186e5 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/tsconfig.json @@ -0,0 +1,16 @@ +{ + "references": [ + { + "path": "./tsconfig.src.json" + }, + { + "path": "./tsconfig.samples.json" + }, + { + "path": "./tsconfig.test.json" + }, + { + "path": "./tsconfig.snippets.json" + } + ] +} diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/tsconfig.samples.json b/sdk/azurestackhcivm/arm-azurestackhcivm/tsconfig.samples.json new file mode 100644 index 000000000000..63ebc5465497 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/tsconfig.samples.json @@ -0,0 +1,8 @@ +{ + "extends": "../../../tsconfig.samples.base.json", + "compilerOptions": { + "paths": { + "@azure/arm-azurestackhcivm": ["./dist/esm"] + } + } +} diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/tsconfig.snippets.json b/sdk/azurestackhcivm/arm-azurestackhcivm/tsconfig.snippets.json new file mode 100644 index 000000000000..6f3148b5ed97 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/tsconfig.snippets.json @@ -0,0 +1,3 @@ +{ + "extends": ["../../../tsconfig.snippets.base.json"] +} diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/tsconfig.src.json b/sdk/azurestackhcivm/arm-azurestackhcivm/tsconfig.src.json new file mode 100644 index 000000000000..bae70752dd38 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/tsconfig.src.json @@ -0,0 +1,3 @@ +{ + "extends": "../../../tsconfig.lib.json" +} diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/tsconfig.test.json b/sdk/azurestackhcivm/arm-azurestackhcivm/tsconfig.test.json new file mode 100644 index 000000000000..290ca214aebc --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/tsconfig.test.json @@ -0,0 +1,3 @@ +{ + "extends": ["./tsconfig.src.json", "../../../tsconfig.test.base.json"] +} diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/tsp-location.yaml b/sdk/azurestackhcivm/arm-azurestackhcivm/tsp-location.yaml new file mode 100644 index 000000000000..0c81a966d3a3 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/tsp-location.yaml @@ -0,0 +1,4 @@ +directory: specification/azurestackhci/AzureStackHCI.StackHCIVM.Management +commit: 897f19441a4cc240eba138296f31e50841a6b57f +repo: Azure/azure-rest-api-specs +additionalDirectories: diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/vitest.browser.config.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/vitest.browser.config.ts new file mode 100644 index 000000000000..46cd5d8beafc --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/vitest.browser.config.ts @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { defineConfig, mergeConfig } from "vitest/config"; +import viteConfig from "../../../vitest.browser.shared.config.ts"; + +export default viteConfig; diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/vitest.config.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/vitest.config.ts new file mode 100644 index 000000000000..96284e6fb31e --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/vitest.config.ts @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { defineConfig, mergeConfig } from "vitest/config"; +import viteConfig from "../../../vitest.shared.config.ts"; + +export default viteConfig; diff --git a/sdk/azurestackhcivm/arm-azurestackhcivm/vitest.esm.config.ts b/sdk/azurestackhcivm/arm-azurestackhcivm/vitest.esm.config.ts new file mode 100644 index 000000000000..5e9735e9b144 --- /dev/null +++ b/sdk/azurestackhcivm/arm-azurestackhcivm/vitest.esm.config.ts @@ -0,0 +1,8 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { mergeConfig } from "vitest/config"; +import vitestConfig from "./vitest.config.ts"; +import vitestEsmConfig from "../../../vitest.esm.shared.config.ts"; + +export default mergeConfig(vitestConfig, vitestEsmConfig); diff --git a/sdk/azurestackhcivm/ci.mgmt.yml b/sdk/azurestackhcivm/ci.mgmt.yml new file mode 100644 index 000000000000..d8cca99c9e9f --- /dev/null +++ b/sdk/azurestackhcivm/ci.mgmt.yml @@ -0,0 +1,35 @@ +# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. + +trigger: + branches: + include: + - main + - feature/* + - release/* + - hotfix/* + exclude: + - feature/v4 + paths: + include: + - sdk/azurestackhcivm/arm-azurestackhcivm + - sdk/azurestackhcivm/ci.mgmt.yml +pr: + branches: + include: + - main + - feature/* + - release/* + - hotfix/* + exclude: + - feature/v4 + paths: + include: + - sdk/azurestackhcivm/arm-azurestackhcivm + - sdk/azurestackhcivm/ci.mgmt.yml +extends: + template: /eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: azurestackhcivm + Artifacts: + - name: azure-arm-azurestackhcivm + safeName: azurearmazurestackhcivm