diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index f7c2cac21fc4..88a2715e8153 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1632,6 +1632,7 @@ sdk/edgeactions/arm-edgeactions/ @qiaozha @MaryGao @JialinHuang803 sdk/managedops/arm-managedops/ @qiaozha @MaryGao @JialinHuang803 # PRLabel: %Mgmt +sdk/computebulkactions/arm-computebulkactions/ @qiaozha @MaryGao @JialinHuang803 sdk/containerregistry/arm-containerregistrytasks/ @qiaozha @MaryGao @JialinHuang803 # PRLabel: %Mgmt diff --git a/eng/ignore-links.txt b/eng/ignore-links.txt index 20ef18dd999e..eefa4a46457d 100644 --- a/eng/ignore-links.txt +++ b/eng/ignore-links.txt @@ -62,6 +62,8 @@ https://learn.microsoft.com/javascript/api/@azure/arm-containerregistrytasks?vie https://learn.microsoft.com/javascript/api/@azure/arm-artifactsigning?view=azure-node-preview https://learn.microsoft.com/javascript/api/@azure/arm-artifactsigning https://www.npmjs.com/package/@azure/arm-managedops +https://learn.microsoft.com/javascript/api/@azure/arm-computebulkactions?view=azure-node-preview +https://www.npmjs.com/package/@azure/arm-computebulkactions https://www.npmjs.com/package/@azure/arm-edgeactions https://www.npmjs.com/package/@azure/arm-containerregistrytasks https://www.npmjs.com/package/@azure/arm-artifactsigning \ No newline at end of file diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 58738c77bea2..f7ee7bf01a79 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -6412,6 +6412,88 @@ importers: specifier: catalog:testing version: 4.0.18(@opentelemetry/api@1.9.0)(@types/node@20.19.33)(@vitest/browser-playwright@4.0.18)(tsx@4.21.0)(yaml@2.8.2) + sdk/computebulkactions/arm-computebulkactions: + 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: workspace:^ + version: link:../../test-utils/test-credential + '@azure-tools/test-recorder': + specifier: workspace:^ + version: link:../../test-utils/recorder + '@azure-tools/test-utils-vitest': + specifier: workspace:^ + version: link:../../test-utils/test-utils-vitest + '@azure/dev-tool': + specifier: workspace:^ + version: link:../../../common/tools/dev-tool + '@azure/eslint-plugin-azure-sdk': + specifier: workspace:^ + version: link:../../../common/tools/eslint-plugin-azure-sdk + '@azure/identity': + specifier: catalog:internal + version: 4.13.0 + '@types/node': + specifier: 'catalog:' + version: 20.19.33 + '@vitest/browser-playwright': + specifier: catalog:testing + version: 4.0.18(playwright@1.58.2)(vite@7.3.1(@types/node@20.19.33)(tsx@4.21.0)(yaml@2.8.2))(vitest@4.0.18) + '@vitest/coverage-istanbul': + specifier: catalog:testing + version: 4.0.18(vitest@4.0.18) + cross-env: + specifier: 'catalog:' + version: 10.1.0 + dotenv: + specifier: catalog:testing + version: 16.6.1 + eslint: + specifier: 'catalog:' + version: 9.39.3 + playwright: + specifier: catalog:testing + version: 1.58.2 + prettier: + specifier: 'catalog:' + version: 3.8.1 + rimraf: + specifier: 'catalog:' + version: 6.1.3 + tshy: + specifier: 'catalog:' + version: 3.3.2 + typescript: + specifier: 'catalog:' + version: 5.9.3 + vitest: + specifier: catalog:testing + version: 4.0.18(@opentelemetry/api@1.9.0)(@types/node@20.19.33)(@vitest/browser-playwright@4.0.18)(tsx@4.21.0)(yaml@2.8.2) + sdk/computefleet/arm-computefleet: dependencies: '@azure-rest/core-client': diff --git a/sdk/computebulkactions/arm-computebulkactions/CHANGELOG.md b/sdk/computebulkactions/arm-computebulkactions/CHANGELOG.md new file mode 100644 index 000000000000..cf44776f214c --- /dev/null +++ b/sdk/computebulkactions/arm-computebulkactions/CHANGELOG.md @@ -0,0 +1,7 @@ +# Release History + +## 1.0.0-beta.1 (2026-02-24) + +### Features Added + +Initial release of the @azure/arm-computebulkactions package diff --git a/sdk/computebulkactions/arm-computebulkactions/LICENSE b/sdk/computebulkactions/arm-computebulkactions/LICENSE new file mode 100644 index 000000000000..63447fd8bbbf --- /dev/null +++ b/sdk/computebulkactions/arm-computebulkactions/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/computebulkactions/arm-computebulkactions/README.md b/sdk/computebulkactions/arm-computebulkactions/README.md new file mode 100644 index 000000000000..4b27910ea06c --- /dev/null +++ b/sdk/computebulkactions/arm-computebulkactions/README.md @@ -0,0 +1,111 @@ +# Azure ComputeBulkActions client library for JavaScript + +This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure ComputeBulkActions client. + +Microsoft.ComputeBulkActions Resource Provider management API. + +Key links: + +- [Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/computebulkactions/arm-computebulkactions) +- [Package (NPM)](https://www.npmjs.com/package/@azure/arm-computebulkactions) +- [API reference documentation](https://learn.microsoft.com/javascript/api/@azure/arm-computebulkactions?view=azure-node-preview) + +## 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-computebulkactions` package + +Install the Azure ComputeBulkActions client library for JavaScript with `npm`: + +```bash +npm install @azure/arm-computebulkactions +``` + +### Create and authenticate a `ComputeBulkActionsClient` + +To create a client object to access the Azure ComputeBulkActions API, you will need the `endpoint` of your Azure ComputeBulkActions resource and a `credential`. The Azure ComputeBulkActions client can use Azure Active Directory credentials to authenticate. +You can find the endpoint for your Azure ComputeBulkActions 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/main/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-with-a-pre-fetched-access-token). + +To use the [DefaultAzureCredential][defaultazurecredential] provider shown below, or other credential providers provided with the Azure SDK, please install the `@azure/identity` package: + +```bash +npm install @azure/identity +``` + +You will also need to **register a new AAD application and grant access to Azure ComputeBulkActions** 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 { ComputeBulkActionsClient } from "@azure/arm-computebulkactions"; +import { DefaultAzureCredential } from "@azure/identity"; + +const subscriptionId = "00000000-0000-0000-0000-000000000000"; +const client = new ComputeBulkActionsClient(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 { ComputeBulkActionsClient } from "@azure/arm-computebulkactions"; + +const credential = new InteractiveBrowserCredential({ + tenantId: "", + clientId: "", +}); +const subscriptionId = "00000000-0000-0000-0000-000000000000"; +const client = new ComputeBulkActionsClient(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 + +### ComputeBulkActionsClient + +`ComputeBulkActionsClient` is the primary interface for developers using the Azure ComputeBulkActions client library. Explore the methods on this client object to understand the different features of the Azure ComputeBulkActions 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). + + +## 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/computebulkactions/arm-computebulkactions/api-extractor.json b/sdk/computebulkactions/arm-computebulkactions/api-extractor.json new file mode 100644 index 000000000000..870d6d399477 --- /dev/null +++ b/sdk/computebulkactions/arm-computebulkactions/api-extractor.json @@ -0,0 +1 @@ +{ "extends": "../../../api-extractor-base.json" } diff --git a/sdk/computebulkactions/arm-computebulkactions/eslint.config.mjs b/sdk/computebulkactions/arm-computebulkactions/eslint.config.mjs new file mode 100644 index 000000000000..6d2f8a5914c3 --- /dev/null +++ b/sdk/computebulkactions/arm-computebulkactions/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/computebulkactions/arm-computebulkactions/metadata.json b/sdk/computebulkactions/arm-computebulkactions/metadata.json new file mode 100644 index 000000000000..3e38f697f559 --- /dev/null +++ b/sdk/computebulkactions/arm-computebulkactions/metadata.json @@ -0,0 +1,196 @@ +{ + "apiVersion": "2026-02-01-preview", + "emitterVersion": "0.49.1", + "crossLanguageDefinitions": { + "CrossLanguagePackageId": "Microsoft.ComputeBulkActions", + "CrossLanguageDefinitionId": { + "@azure/arm-computebulkactions!OperationListResult:interface": "Azure.ResourceManager.CommonTypes.OperationListResult", + "@azure/arm-computebulkactions!Operation:interface": "Azure.ResourceManager.CommonTypes.Operation", + "@azure/arm-computebulkactions!OperationDisplay:interface": "Azure.ResourceManager.CommonTypes.OperationDisplay", + "@azure/arm-computebulkactions!ErrorResponse:interface": "Azure.ResourceManager.CommonTypes.ErrorResponse", + "@azure/arm-computebulkactions!ErrorDetail:interface": "Azure.ResourceManager.CommonTypes.ErrorDetail", + "@azure/arm-computebulkactions!ErrorAdditionalInfo:interface": "Azure.ResourceManager.CommonTypes.ErrorAdditionalInfo", + "@azure/arm-computebulkactions!LocationBasedLaunchBulkInstancesOperation:interface": "Microsoft.ComputeBulkActions.LocationBasedLaunchBulkInstancesOperation", + "@azure/arm-computebulkactions!LaunchBulkInstancesOperationProperties:interface": "Microsoft.ComputeBulkActions.LaunchBulkInstancesOperationProperties", + "@azure/arm-computebulkactions!PriorityProfile:interface": "Microsoft.ComputeBulkActions.PriorityProfile", + "@azure/arm-computebulkactions!VmSizeProfile:interface": "Microsoft.ComputeBulkActions.VmSizeProfile", + "@azure/arm-computebulkactions!VMAttributes:interface": "Microsoft.ComputeBulkActions.VMAttributes", + "@azure/arm-computebulkactions!VMAttributeMinMaxInteger:interface": "Microsoft.ComputeBulkActions.VMAttributeMinMaxInteger", + "@azure/arm-computebulkactions!VMAttributeMinMaxDouble:interface": "Microsoft.ComputeBulkActions.VMAttributeMinMaxDouble", + "@azure/arm-computebulkactions!ComputeProfile:interface": "Microsoft.ComputeBulkActions.ComputeProfile", + "@azure/arm-computebulkactions!VirtualMachineProfile:interface": "Microsoft.ComputeBulkActions.VirtualMachineProfile", + "@azure/arm-computebulkactions!ScheduledEventsPolicy:interface": "Microsoft.ComputeBulkActions.ScheduledEventsPolicy", + "@azure/arm-computebulkactions!UserInitiatedRedeploy:interface": "Microsoft.ComputeBulkActions.UserInitiatedRedeploy", + "@azure/arm-computebulkactions!UserInitiatedReboot:interface": "Microsoft.ComputeBulkActions.UserInitiatedReboot", + "@azure/arm-computebulkactions!ScheduledEventsAdditionalPublishingTargets:interface": "Microsoft.ComputeBulkActions.ScheduledEventsAdditionalPublishingTargets", + "@azure/arm-computebulkactions!EventGridAndResourceGraph:interface": "Microsoft.ComputeBulkActions.EventGridAndResourceGraph", + "@azure/arm-computebulkactions!AllInstancesDown:interface": "Microsoft.ComputeBulkActions.AllInstancesDown", + "@azure/arm-computebulkactions!StorageProfile:interface": "Microsoft.ComputeBulkActions.StorageProfile", + "@azure/arm-computebulkactions!ImageReference:interface": "Microsoft.ComputeBulkActions.ImageReference", + "@azure/arm-computebulkactions!SubResource:interface": "Microsoft.ComputeBulkActions.SubResource", + "@azure/arm-computebulkactions!OSDisk:interface": "Microsoft.ComputeBulkActions.OSDisk", + "@azure/arm-computebulkactions!DiskEncryptionSettings:interface": "Microsoft.ComputeBulkActions.DiskEncryptionSettings", + "@azure/arm-computebulkactions!KeyVaultSecretReference:interface": "Microsoft.ComputeBulkActions.KeyVaultSecretReference", + "@azure/arm-computebulkactions!KeyVaultKeyReference:interface": "Microsoft.ComputeBulkActions.KeyVaultKeyReference", + "@azure/arm-computebulkactions!VirtualHardDisk:interface": "Microsoft.ComputeBulkActions.VirtualHardDisk", + "@azure/arm-computebulkactions!DiffDiskSettings:interface": "Microsoft.ComputeBulkActions.DiffDiskSettings", + "@azure/arm-computebulkactions!ManagedDiskParameters:interface": "Microsoft.ComputeBulkActions.ManagedDiskParameters", + "@azure/arm-computebulkactions!DiskEncryptionSetParameters:interface": "Microsoft.ComputeBulkActions.DiskEncryptionSetParameters", + "@azure/arm-computebulkactions!VMDiskSecurityProfile:interface": "Microsoft.ComputeBulkActions.VMDiskSecurityProfile", + "@azure/arm-computebulkactions!DataDisk:interface": "Microsoft.ComputeBulkActions.DataDisk", + "@azure/arm-computebulkactions!ApiEntityReference:interface": "Microsoft.ComputeBulkActions.ApiEntityReference", + "@azure/arm-computebulkactions!AdditionalCapabilities:interface": "Microsoft.ComputeBulkActions.AdditionalCapabilities", + "@azure/arm-computebulkactions!OSProfile:interface": "Microsoft.ComputeBulkActions.OSProfile", + "@azure/arm-computebulkactions!WindowsConfiguration:interface": "Microsoft.ComputeBulkActions.WindowsConfiguration", + "@azure/arm-computebulkactions!AdditionalUnattendContent:interface": "Microsoft.ComputeBulkActions.AdditionalUnattendContent", + "@azure/arm-computebulkactions!PatchSettings:interface": "Microsoft.ComputeBulkActions.PatchSettings", + "@azure/arm-computebulkactions!WindowsVMGuestPatchAutomaticByPlatformSettings:interface": "Microsoft.ComputeBulkActions.WindowsVMGuestPatchAutomaticByPlatformSettings", + "@azure/arm-computebulkactions!WinRMConfiguration:interface": "Microsoft.ComputeBulkActions.WinRMConfiguration", + "@azure/arm-computebulkactions!WinRMListener:interface": "Microsoft.ComputeBulkActions.WinRMListener", + "@azure/arm-computebulkactions!LinuxConfiguration:interface": "Microsoft.ComputeBulkActions.LinuxConfiguration", + "@azure/arm-computebulkactions!SshConfiguration:interface": "Microsoft.ComputeBulkActions.SshConfiguration", + "@azure/arm-computebulkactions!SshPublicKey:interface": "Microsoft.ComputeBulkActions.SshPublicKey", + "@azure/arm-computebulkactions!LinuxPatchSettings:interface": "Microsoft.ComputeBulkActions.LinuxPatchSettings", + "@azure/arm-computebulkactions!LinuxVMGuestPatchAutomaticByPlatformSettings:interface": "Microsoft.ComputeBulkActions.LinuxVMGuestPatchAutomaticByPlatformSettings", + "@azure/arm-computebulkactions!VaultSecretGroup:interface": "Microsoft.ComputeBulkActions.VaultSecretGroup", + "@azure/arm-computebulkactions!VaultCertificate:interface": "Microsoft.ComputeBulkActions.VaultCertificate", + "@azure/arm-computebulkactions!NetworkProfile:interface": "Microsoft.ComputeBulkActions.NetworkProfile", + "@azure/arm-computebulkactions!NetworkInterfaceReference:interface": "Microsoft.ComputeBulkActions.NetworkInterfaceReference", + "@azure/arm-computebulkactions!NetworkInterfaceReferenceProperties:interface": "Microsoft.ComputeBulkActions.NetworkInterfaceReferenceProperties", + "@azure/arm-computebulkactions!VirtualMachineNetworkInterfaceConfiguration:interface": "Microsoft.ComputeBulkActions.VirtualMachineNetworkInterfaceConfiguration", + "@azure/arm-computebulkactions!VirtualMachineNetworkInterfaceConfigurationProperties:interface": "Microsoft.ComputeBulkActions.VirtualMachineNetworkInterfaceConfigurationProperties", + "@azure/arm-computebulkactions!VirtualMachineNetworkInterfaceDnsSettingsConfiguration:interface": "Microsoft.ComputeBulkActions.VirtualMachineNetworkInterfaceDnsSettingsConfiguration", + "@azure/arm-computebulkactions!VirtualMachineNetworkInterfaceIPConfiguration:interface": "Microsoft.ComputeBulkActions.VirtualMachineNetworkInterfaceIPConfiguration", + "@azure/arm-computebulkactions!VirtualMachineNetworkInterfaceIPConfigurationProperties:interface": "Microsoft.ComputeBulkActions.VirtualMachineNetworkInterfaceIPConfigurationProperties", + "@azure/arm-computebulkactions!VirtualMachinePublicIPAddressConfiguration:interface": "Microsoft.ComputeBulkActions.VirtualMachinePublicIPAddressConfiguration", + "@azure/arm-computebulkactions!VirtualMachinePublicIPAddressConfigurationProperties:interface": "Microsoft.ComputeBulkActions.VirtualMachinePublicIPAddressConfigurationProperties", + "@azure/arm-computebulkactions!VirtualMachinePublicIPAddressDnsSettingsConfiguration:interface": "Microsoft.ComputeBulkActions.VirtualMachinePublicIPAddressDnsSettingsConfiguration", + "@azure/arm-computebulkactions!VirtualMachineIpTag:interface": "Microsoft.ComputeBulkActions.VirtualMachineIpTag", + "@azure/arm-computebulkactions!PublicIPAddressSku:interface": "Microsoft.ComputeBulkActions.PublicIPAddressSku", + "@azure/arm-computebulkactions!SecurityProfile:interface": "Microsoft.ComputeBulkActions.SecurityProfile", + "@azure/arm-computebulkactions!UefiSettings:interface": "Microsoft.ComputeBulkActions.UefiSettings", + "@azure/arm-computebulkactions!EncryptionIdentity:interface": "Microsoft.ComputeBulkActions.EncryptionIdentity", + "@azure/arm-computebulkactions!ProxyAgentSettings:interface": "Microsoft.ComputeBulkActions.ProxyAgentSettings", + "@azure/arm-computebulkactions!HostEndpointSettings:interface": "Microsoft.ComputeBulkActions.HostEndpointSettings", + "@azure/arm-computebulkactions!DiagnosticsProfile:interface": "Microsoft.ComputeBulkActions.DiagnosticsProfile", + "@azure/arm-computebulkactions!BootDiagnostics:interface": "Microsoft.ComputeBulkActions.BootDiagnostics", + "@azure/arm-computebulkactions!ScheduledEventsProfile:interface": "Microsoft.ComputeBulkActions.ScheduledEventsProfile", + "@azure/arm-computebulkactions!TerminateNotificationProfile:interface": "Microsoft.ComputeBulkActions.TerminateNotificationProfile", + "@azure/arm-computebulkactions!OSImageNotificationProfile:interface": "Microsoft.ComputeBulkActions.OSImageNotificationProfile", + "@azure/arm-computebulkactions!CapacityReservationProfile:interface": "Microsoft.ComputeBulkActions.CapacityReservationProfile", + "@azure/arm-computebulkactions!ApplicationProfile:interface": "Microsoft.ComputeBulkActions.ApplicationProfile", + "@azure/arm-computebulkactions!VMGalleryApplication:interface": "Microsoft.ComputeBulkActions.VMGalleryApplication", + "@azure/arm-computebulkactions!VirtualMachineExtension:interface": "Microsoft.ComputeBulkActions.VirtualMachineExtension", + "@azure/arm-computebulkactions!VirtualMachineExtensionProperties:interface": "Microsoft.ComputeBulkActions.VirtualMachineExtensionProperties", + "@azure/arm-computebulkactions!ZoneAllocationPolicy:interface": "Microsoft.ComputeBulkActions.ZoneAllocationPolicy", + "@azure/arm-computebulkactions!ZonePreference:interface": "Microsoft.ComputeBulkActions.ZonePreference", + "@azure/arm-computebulkactions!RetryPolicy:interface": "Microsoft.ComputeBulkActions.RetryPolicy", + "@azure/arm-computebulkactions!ManagedServiceIdentity:interface": "Azure.ResourceManager.CommonTypes.ManagedServiceIdentity", + "@azure/arm-computebulkactions!UserAssignedIdentity:interface": "Azure.ResourceManager.CommonTypes.UserAssignedIdentity", + "@azure/arm-computebulkactions!Plan:interface": "Azure.ResourceManager.CommonTypes.Plan", + "@azure/arm-computebulkactions!ProxyResource:interface": "Azure.ResourceManager.CommonTypes.ProxyResource", + "@azure/arm-computebulkactions!Resource:interface": "Azure.ResourceManager.CommonTypes.Resource", + "@azure/arm-computebulkactions!SystemData:interface": "Azure.ResourceManager.CommonTypes.SystemData", + "@azure/arm-computebulkactions!OperationStatusResult:interface": "Azure.ResourceManager.CommonTypes.OperationStatusResult", + "@azure/arm-computebulkactions!ArmOperationStatusResourceProvisioningState:interface": "Azure.ResourceManager.ArmOperationStatus", + "@azure/arm-computebulkactions!LaunchBulkInstancesOperationListResult:interface": "Microsoft.ComputeBulkActions.LaunchBulkInstancesOperationListResult", + "@azure/arm-computebulkactions!VirtualMachineListResult:interface": "Microsoft.ComputeBulkActions.VirtualMachineListResult", + "@azure/arm-computebulkactions!VirtualMachine:interface": "Microsoft.ComputeBulkActions.VirtualMachine", + "@azure/arm-computebulkactions!ApiError:interface": "Microsoft.ComputeBulkActions.ApiError", + "@azure/arm-computebulkactions!ApiErrorBase:interface": "Microsoft.ComputeBulkActions.ApiErrorBase", + "@azure/arm-computebulkactions!InnerError:interface": "Microsoft.ComputeBulkActions.InnerError", + "@azure/arm-computebulkactions!ExecuteDeallocateRequest:interface": "Microsoft.ComputeBulkActions.ExecuteDeallocateRequest", + "@azure/arm-computebulkactions!ExecutionParameters:interface": "Microsoft.ComputeBulkActions.ExecutionParameters", + "@azure/arm-computebulkactions!Resources:interface": "Microsoft.ComputeBulkActions.Resources", + "@azure/arm-computebulkactions!DeallocateResourceOperationResponse:interface": "Microsoft.ComputeBulkActions.DeallocateResourceOperationResponse", + "@azure/arm-computebulkactions!ResourceOperation:interface": "Microsoft.ComputeBulkActions.ResourceOperation", + "@azure/arm-computebulkactions!ResourceOperationDetails:interface": "Microsoft.ComputeBulkActions.ResourceOperationDetails", + "@azure/arm-computebulkactions!ResourceOperationError:interface": "Microsoft.ComputeBulkActions.ResourceOperationError", + "@azure/arm-computebulkactions!ExecuteHibernateRequest:interface": "Microsoft.ComputeBulkActions.ExecuteHibernateRequest", + "@azure/arm-computebulkactions!HibernateResourceOperationResponse:interface": "Microsoft.ComputeBulkActions.HibernateResourceOperationResponse", + "@azure/arm-computebulkactions!ExecuteStartRequest:interface": "Microsoft.ComputeBulkActions.ExecuteStartRequest", + "@azure/arm-computebulkactions!StartResourceOperationResponse:interface": "Microsoft.ComputeBulkActions.StartResourceOperationResponse", + "@azure/arm-computebulkactions!ExecuteCreateRequest:interface": "Microsoft.ComputeBulkActions.ExecuteCreateRequest", + "@azure/arm-computebulkactions!ResourceProvisionPayload:interface": "Microsoft.ComputeBulkActions.ResourceProvisionPayload", + "@azure/arm-computebulkactions!CreateResourceOperationResponse:interface": "Microsoft.ComputeBulkActions.CreateResourceOperationResponse", + "@azure/arm-computebulkactions!ExecuteDeleteRequest:interface": "Microsoft.ComputeBulkActions.ExecuteDeleteRequest", + "@azure/arm-computebulkactions!DeleteResourceOperationResponse:interface": "Microsoft.ComputeBulkActions.DeleteResourceOperationResponse", + "@azure/arm-computebulkactions!GetOperationStatusRequest:interface": "Microsoft.ComputeBulkActions.GetOperationStatusRequest", + "@azure/arm-computebulkactions!GetOperationStatusResponse:interface": "Microsoft.ComputeBulkActions.GetOperationStatusResponse", + "@azure/arm-computebulkactions!CancelOperationsRequest:interface": "Microsoft.ComputeBulkActions.CancelOperationsRequest", + "@azure/arm-computebulkactions!CancelOperationsResponse:interface": "Microsoft.ComputeBulkActions.CancelOperationsResponse", + "@azure/arm-computebulkactions!KnownOrigin:enum": "Azure.ResourceManager.CommonTypes.Origin", + "@azure/arm-computebulkactions!KnownActionType:enum": "Azure.ResourceManager.CommonTypes.ActionType", + "@azure/arm-computebulkactions!KnownProvisioningState:enum": "Microsoft.ComputeBulkActions.ProvisioningState", + "@azure/arm-computebulkactions!KnownCapacityType:enum": "Microsoft.ComputeBulkActions.CapacityType", + "@azure/arm-computebulkactions!KnownVirtualMachineType:enum": "Microsoft.ComputeBulkActions.VirtualMachineType", + "@azure/arm-computebulkactions!KnownEvictionPolicy:enum": "Microsoft.ComputeBulkActions.EvictionPolicy", + "@azure/arm-computebulkactions!KnownAllocationStrategy:enum": "Microsoft.ComputeBulkActions.AllocationStrategy", + "@azure/arm-computebulkactions!KnownArchitectureType:enum": "Microsoft.ComputeBulkActions.ArchitectureType", + "@azure/arm-computebulkactions!KnownVMAttributeSupport:enum": "Microsoft.ComputeBulkActions.VMAttributeSupport", + "@azure/arm-computebulkactions!KnownLocalStorageDiskType:enum": "Microsoft.ComputeBulkActions.LocalStorageDiskType", + "@azure/arm-computebulkactions!KnownAcceleratorManufacturer:enum": "Microsoft.ComputeBulkActions.AcceleratorManufacturer", + "@azure/arm-computebulkactions!KnownAcceleratorType:enum": "Microsoft.ComputeBulkActions.AcceleratorType", + "@azure/arm-computebulkactions!KnownVMCategory:enum": "Microsoft.ComputeBulkActions.VMCategory", + "@azure/arm-computebulkactions!KnownCpuManufacturer:enum": "Microsoft.ComputeBulkActions.CpuManufacturer", + "@azure/arm-computebulkactions!KnownHyperVGeneration:enum": "Microsoft.ComputeBulkActions.HyperVGeneration", + "@azure/arm-computebulkactions!KnownOperatingSystemTypes:enum": "Microsoft.ComputeBulkActions.OperatingSystemTypes", + "@azure/arm-computebulkactions!KnownCachingTypes:enum": "Microsoft.ComputeBulkActions.CachingTypes", + "@azure/arm-computebulkactions!KnownDiffDiskOptions:enum": "Microsoft.ComputeBulkActions.DiffDiskOptions", + "@azure/arm-computebulkactions!KnownDiffDiskPlacement:enum": "Microsoft.ComputeBulkActions.DiffDiskPlacement", + "@azure/arm-computebulkactions!KnownDiskCreateOptionTypes:enum": "Microsoft.ComputeBulkActions.DiskCreateOptionTypes", + "@azure/arm-computebulkactions!KnownStorageAccountTypes:enum": "Microsoft.ComputeBulkActions.StorageAccountTypes", + "@azure/arm-computebulkactions!KnownSecurityEncryptionTypes:enum": "Microsoft.ComputeBulkActions.SecurityEncryptionTypes", + "@azure/arm-computebulkactions!KnownDiskDeleteOptionTypes:enum": "Microsoft.ComputeBulkActions.DiskDeleteOptionTypes", + "@azure/arm-computebulkactions!KnownDiskDetachOptionTypes:enum": "Microsoft.ComputeBulkActions.DiskDetachOptionTypes", + "@azure/arm-computebulkactions!KnownDiskControllerTypes:enum": "Microsoft.ComputeBulkActions.DiskControllerTypes", + "@azure/arm-computebulkactions!KnownSettingNames:enum": "Microsoft.ComputeBulkActions.SettingNames", + "@azure/arm-computebulkactions!KnownWindowsVMGuestPatchMode:enum": "Microsoft.ComputeBulkActions.WindowsVMGuestPatchMode", + "@azure/arm-computebulkactions!KnownWindowsPatchAssessmentMode:enum": "Microsoft.ComputeBulkActions.WindowsPatchAssessmentMode", + "@azure/arm-computebulkactions!KnownWindowsVMGuestPatchAutomaticByPlatformRebootSetting:enum": "Microsoft.ComputeBulkActions.WindowsVMGuestPatchAutomaticByPlatformRebootSetting", + "@azure/arm-computebulkactions!KnownProtocolTypes:enum": "Microsoft.ComputeBulkActions.ProtocolTypes", + "@azure/arm-computebulkactions!KnownLinuxVMGuestPatchMode:enum": "Microsoft.ComputeBulkActions.LinuxVMGuestPatchMode", + "@azure/arm-computebulkactions!KnownLinuxPatchAssessmentMode:enum": "Microsoft.ComputeBulkActions.LinuxPatchAssessmentMode", + "@azure/arm-computebulkactions!KnownLinuxVMGuestPatchAutomaticByPlatformRebootSetting:enum": "Microsoft.ComputeBulkActions.LinuxVMGuestPatchAutomaticByPlatformRebootSetting", + "@azure/arm-computebulkactions!KnownDeleteOptions:enum": "Microsoft.ComputeBulkActions.DeleteOptions", + "@azure/arm-computebulkactions!KnownNetworkApiVersion:enum": "Microsoft.ComputeBulkActions.NetworkApiVersion", + "@azure/arm-computebulkactions!KnownDomainNameLabelScopeTypes:enum": "Microsoft.ComputeBulkActions.DomainNameLabelScopeTypes", + "@azure/arm-computebulkactions!KnownIPVersions:enum": "Microsoft.ComputeBulkActions.IPVersions", + "@azure/arm-computebulkactions!KnownPublicIPAllocationMethod:enum": "Microsoft.ComputeBulkActions.PublicIPAllocationMethod", + "@azure/arm-computebulkactions!KnownPublicIPAddressSkuName:enum": "Microsoft.ComputeBulkActions.PublicIPAddressSkuName", + "@azure/arm-computebulkactions!KnownPublicIPAddressSkuTier:enum": "Microsoft.ComputeBulkActions.PublicIPAddressSkuTier", + "@azure/arm-computebulkactions!KnownNetworkInterfaceAuxiliaryMode:enum": "Microsoft.ComputeBulkActions.NetworkInterfaceAuxiliaryMode", + "@azure/arm-computebulkactions!KnownNetworkInterfaceAuxiliarySku:enum": "Microsoft.ComputeBulkActions.NetworkInterfaceAuxiliarySku", + "@azure/arm-computebulkactions!KnownSecurityTypes:enum": "Microsoft.ComputeBulkActions.SecurityTypes", + "@azure/arm-computebulkactions!KnownMode:enum": "Microsoft.ComputeBulkActions.Mode", + "@azure/arm-computebulkactions!KnownModes:enum": "Microsoft.ComputeBulkActions.Modes", + "@azure/arm-computebulkactions!KnownZoneDistributionStrategy:enum": "Microsoft.ComputeBulkActions.ZoneDistributionStrategy", + "@azure/arm-computebulkactions!KnownManagedServiceIdentityType:enum": "Azure.ResourceManager.CommonTypes.ManagedServiceIdentityType", + "@azure/arm-computebulkactions!KnowncreatedByType:enum": "Azure.ResourceManager.CommonTypes.createdByType", + "@azure/arm-computebulkactions!KnownResourceProvisioningState:enum": "Azure.ResourceManager.ResourceProvisioningState", + "@azure/arm-computebulkactions!KnownVMOperationStatus:enum": "Microsoft.ComputeBulkActions.VMOperationStatus", + "@azure/arm-computebulkactions!KnownOptimizationPreference:enum": "Microsoft.ComputeBulkActions.OptimizationPreference", + "@azure/arm-computebulkactions!KnownResourceOperationType:enum": "Microsoft.ComputeBulkActions.ResourceOperationType", + "@azure/arm-computebulkactions!KnownDeadlineType:enum": "Microsoft.ComputeBulkActions.DeadlineType", + "@azure/arm-computebulkactions!KnownOperationState:enum": "Microsoft.ComputeBulkActions.OperationState", + "@azure/arm-computebulkactions!KnownVersions:enum": "Microsoft.ComputeBulkActions.Versions", + "@azure/arm-computebulkactions!ManagedServiceIdentityUserAssignedIdentity:type": "Azure.ResourceManager.CommonTypes.ManagedServiceIdentity.userAssignedIdentity.anonymous", + "@azure/arm-computebulkactions!BulkActionsOperations#virtualMachinesCancelOperations:member": "Microsoft.ComputeBulkActions.BulkActions.virtualMachinesCancelOperations", + "@azure/arm-computebulkactions!BulkActionsOperations#virtualMachinesGetOperationStatus:member": "Microsoft.ComputeBulkActions.BulkActions.virtualMachinesGetOperationStatus", + "@azure/arm-computebulkactions!BulkActionsOperations#virtualMachinesExecuteDelete:member": "Microsoft.ComputeBulkActions.BulkActions.virtualMachinesExecuteDelete", + "@azure/arm-computebulkactions!BulkActionsOperations#virtualMachinesExecuteCreate:member": "Microsoft.ComputeBulkActions.BulkActions.virtualMachinesExecuteCreate", + "@azure/arm-computebulkactions!BulkActionsOperations#virtualMachinesExecuteStart:member": "Microsoft.ComputeBulkActions.BulkActions.virtualMachinesExecuteStart", + "@azure/arm-computebulkactions!BulkActionsOperations#virtualMachinesExecuteHibernate:member": "Microsoft.ComputeBulkActions.BulkActions.virtualMachinesExecuteHibernate", + "@azure/arm-computebulkactions!BulkActionsOperations#virtualMachinesExecuteDeallocate:member": "Microsoft.ComputeBulkActions.BulkActions.virtualMachinesExecuteDeallocate", + "@azure/arm-computebulkactions!BulkActionsOperations#listVirtualMachines:member": "Microsoft.ComputeBulkActions.BulkActions.listVirtualMachines", + "@azure/arm-computebulkactions!BulkActionsOperations#listBySubscription:member": "Microsoft.ComputeBulkActions.BulkActions.listBySubscription", + "@azure/arm-computebulkactions!BulkActionsOperations#listByResourceGroup:member": "Microsoft.ComputeBulkActions.BulkActions.listByResourceGroup", + "@azure/arm-computebulkactions!BulkActionsOperations#cancel:member": "Microsoft.ComputeBulkActions.BulkActions.cancel", + "@azure/arm-computebulkactions!BulkActionsOperations#delete:member": "Microsoft.ComputeBulkActions.BulkActions.delete", + "@azure/arm-computebulkactions!BulkActionsOperations#createOrUpdate:member": "Microsoft.ComputeBulkActions.BulkActions.createOrUpdate", + "@azure/arm-computebulkactions!BulkActionsOperations#getOperationStatus:member": "Microsoft.ComputeBulkActions.BulkActions.getOperationStatus", + "@azure/arm-computebulkactions!BulkActionsOperations#get:member": "Microsoft.ComputeBulkActions.BulkActions.get", + "@azure/arm-computebulkactions!OperationsOperations#list:member": "Azure.ResourceManager.Operations.list" + } + } +} diff --git a/sdk/computebulkactions/arm-computebulkactions/package.json b/sdk/computebulkactions/arm-computebulkactions/package.json new file mode 100644 index 000000000000..248086a24166 --- /dev/null +++ b/sdk/computebulkactions/arm-computebulkactions/package.json @@ -0,0 +1,208 @@ +{ + "name": "@azure/arm-computebulkactions", + "version": "1.0.0-beta.1", + "description": "A generated SDK for ComputeBulkActionsClient.", + "engines": { + "node": ">=20.0.0" + }, + "sideEffects": false, + "autoPublish": false, + "tshy": { + "exports": { + "./package.json": "./package.json", + ".": "./src/index.ts", + "./api": "./src/api/index.ts", + "./api/bulkActions": "./src/api/bulkActions/index.ts", + "./api/operations": "./src/api/operations/index.ts", + "./models": "./src/models/index.ts" + }, + "dialects": [ + "esm", + "commonjs" + ], + "esmDialects": [ + "browser", + "react-native" + ], + "selfLink": false, + "project": "../../../tsconfig.src.build.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/computebulkactions/arm-computebulkactions/README.md", + "prettier": "@azure/eslint-plugin-azure-sdk/prettier.json", + "//metadata": { + "constantPaths": [ + { + "path": "src/api/computeBulkActionsContext.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": "workspace:^", + "@azure-tools/test-recorder": "workspace:^", + "@azure-tools/test-utils-vitest": "workspace:^", + "@azure/dev-tool": "workspace:^", + "tshy": "catalog:", + "@azure/eslint-plugin-azure-sdk": "workspace:^", + "@azure/identity": "catalog:internal", + "@types/node": "catalog:", + "cross-env": "catalog:", + "eslint": "catalog:", + "prettier": "catalog:", + "rimraf": "catalog:", + "@vitest/browser-playwright": "catalog:testing", + "@vitest/coverage-istanbul": "catalog:testing", + "dotenv": "catalog:testing", + "playwright": "catalog:testing", + "typescript": "catalog:", + "vitest": "catalog:testing" + }, + "scripts": { + "clean": "rimraf --glob dist dist-browser dist-esm test-dist temp types *.tgz *.log", + "extract-api": "rimraf review && dev-tool run extract-api", + "pack": "pnpm pack 2>&1", + "lint": "echo skipped", + "lint:fix": "echo skipped", + "build:samples": "echo skipped", + "check-format": "prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.{ts,cts,mts}\" \"test/**/*.{ts,cts,mts}\" \"*.{js,cjs,mjs,json}\" ", + "execute:samples": "echo skipped", + "format": "prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.{ts,cts,mts}\" \"test/**/*.{ts,cts,mts}\" \"*.{js,cjs,mjs,json}\" ", + "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" + }, + "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/bulkActions": { + "browser": { + "types": "./dist/browser/api/bulkActions/index.d.ts", + "default": "./dist/browser/api/bulkActions/index.js" + }, + "react-native": { + "types": "./dist/react-native/api/bulkActions/index.d.ts", + "default": "./dist/react-native/api/bulkActions/index.js" + }, + "import": { + "types": "./dist/esm/api/bulkActions/index.d.ts", + "default": "./dist/esm/api/bulkActions/index.js" + }, + "require": { + "types": "./dist/commonjs/api/bulkActions/index.d.ts", + "default": "./dist/commonjs/api/bulkActions/index.js" + } + }, + "./api/operations": { + "browser": { + "types": "./dist/browser/api/operations/index.d.ts", + "default": "./dist/browser/api/operations/index.js" + }, + "react-native": { + "types": "./dist/react-native/api/operations/index.d.ts", + "default": "./dist/react-native/api/operations/index.js" + }, + "import": { + "types": "./dist/esm/api/operations/index.d.ts", + "default": "./dist/esm/api/operations/index.js" + }, + "require": { + "types": "./dist/commonjs/api/operations/index.d.ts", + "default": "./dist/commonjs/api/operations/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/computebulkactions/arm-computebulkactions/review/arm-computebulkactions-api-bulkActions-node.api.md b/sdk/computebulkactions/arm-computebulkactions/review/arm-computebulkactions-api-bulkActions-node.api.md new file mode 100644 index 000000000000..d77695666a65 --- /dev/null +++ b/sdk/computebulkactions/arm-computebulkactions/review/arm-computebulkactions-api-bulkActions-node.api.md @@ -0,0 +1,125 @@ +## API Report File for "@azure/arm-computebulkactions" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +import type { Client } from '@azure-rest/core-client'; +import type { OperationOptions } from '@azure-rest/core-client'; +import type { OperationState as OperationState_2 } from '@azure/core-lro'; +import type { PollerLike } from '@azure/core-lro'; + +// @public +export function $delete(context: ComputeBulkActionsContext, resourceGroupName: string, location: string, name: string, options?: BulkActionsDeleteOptionalParams): PollerLike, void>; + +// @public +export interface BulkActionsCancelOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface BulkActionsCreateOrUpdateOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface BulkActionsDeleteOptionalParams extends OperationOptions { + deleteInstances?: boolean; + updateIntervalInMs?: number; +} + +// @public +export interface BulkActionsGetOperationStatusOptionalParams extends OperationOptions { +} + +// @public +export interface BulkActionsGetOptionalParams extends OperationOptions { +} + +// @public +export interface BulkActionsListByResourceGroupOptionalParams extends OperationOptions { +} + +// @public +export interface BulkActionsListBySubscriptionOptionalParams extends OperationOptions { +} + +// @public +export interface BulkActionsListVirtualMachinesOptionalParams extends OperationOptions { + filter?: string; + skiptoken?: string; +} + +// @public +export interface BulkActionsVirtualMachinesCancelOperationsOptionalParams extends OperationOptions { +} + +// @public +export interface BulkActionsVirtualMachinesExecuteCreateOptionalParams extends OperationOptions { +} + +// @public +export interface BulkActionsVirtualMachinesExecuteDeallocateOptionalParams extends OperationOptions { +} + +// @public +export interface BulkActionsVirtualMachinesExecuteDeleteOptionalParams extends OperationOptions { +} + +// @public +export interface BulkActionsVirtualMachinesExecuteHibernateOptionalParams extends OperationOptions { +} + +// @public +export interface BulkActionsVirtualMachinesExecuteStartOptionalParams extends OperationOptions { +} + +// @public +export interface BulkActionsVirtualMachinesGetOperationStatusOptionalParams extends OperationOptions { +} + +// @public +export function cancel(context: ComputeBulkActionsContext, resourceGroupName: string, location: string, name: string, options?: BulkActionsCancelOptionalParams): PollerLike, void>; + +// @public +export function createOrUpdate(context: ComputeBulkActionsContext, resourceGroupName: string, location: string, name: string, resource: LocationBasedLaunchBulkInstancesOperation, options?: BulkActionsCreateOrUpdateOptionalParams): PollerLike, LocationBasedLaunchBulkInstancesOperation>; + +// @public +export function get(context: ComputeBulkActionsContext, resourceGroupName: string, location: string, name: string, options?: BulkActionsGetOptionalParams): Promise; + +// @public +export function getOperationStatus(context: ComputeBulkActionsContext, location: string, id: string, options?: BulkActionsGetOperationStatusOptionalParams): Promise; + +// @public +export function listByResourceGroup(context: ComputeBulkActionsContext, resourceGroupName: string, location: string, options?: BulkActionsListByResourceGroupOptionalParams): PagedAsyncIterableIterator; + +// @public +export function listBySubscription(context: ComputeBulkActionsContext, location: string, options?: BulkActionsListBySubscriptionOptionalParams): PagedAsyncIterableIterator; + +// @public +export function listVirtualMachines(context: ComputeBulkActionsContext, resourceGroupName: string, location: string, name: string, options?: BulkActionsListVirtualMachinesOptionalParams): PagedAsyncIterableIterator; + +// @public +export function virtualMachinesCancelOperations(context: ComputeBulkActionsContext, location: string, requestBody: CancelOperationsRequest, options?: BulkActionsVirtualMachinesCancelOperationsOptionalParams): Promise; + +// @public +export function virtualMachinesExecuteCreate(context: ComputeBulkActionsContext, location: string, requestBody: ExecuteCreateRequest, options?: BulkActionsVirtualMachinesExecuteCreateOptionalParams): Promise; + +// @public +export function virtualMachinesExecuteDeallocate(context: ComputeBulkActionsContext, location: string, requestBody: ExecuteDeallocateRequest, options?: BulkActionsVirtualMachinesExecuteDeallocateOptionalParams): Promise; + +// @public +export function virtualMachinesExecuteDelete(context: ComputeBulkActionsContext, location: string, requestBody: ExecuteDeleteRequest, options?: BulkActionsVirtualMachinesExecuteDeleteOptionalParams): Promise; + +// @public +export function virtualMachinesExecuteHibernate(context: ComputeBulkActionsContext, location: string, requestBody: ExecuteHibernateRequest, options?: BulkActionsVirtualMachinesExecuteHibernateOptionalParams): Promise; + +// @public +export function virtualMachinesExecuteStart(context: ComputeBulkActionsContext, location: string, requestBody: ExecuteStartRequest, options?: BulkActionsVirtualMachinesExecuteStartOptionalParams): Promise; + +// @public +export function virtualMachinesGetOperationStatus(context: ComputeBulkActionsContext, location: string, requestBody: GetOperationStatusRequest, options?: BulkActionsVirtualMachinesGetOperationStatusOptionalParams): Promise; + +// (No @packageDocumentation comment for this package) + +``` diff --git a/sdk/computebulkactions/arm-computebulkactions/review/arm-computebulkactions-api-node.api.md b/sdk/computebulkactions/arm-computebulkactions/review/arm-computebulkactions-api-node.api.md new file mode 100644 index 000000000000..3135424ebc5c --- /dev/null +++ b/sdk/computebulkactions/arm-computebulkactions/review/arm-computebulkactions-api-node.api.md @@ -0,0 +1,28 @@ +## API Report File for "@azure/arm-computebulkactions" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +import type { Client } from '@azure-rest/core-client'; +import type { ClientOptions } from '@azure-rest/core-client'; +import type { TokenCredential } from '@azure/core-auth'; + +// @public +export interface ComputeBulkActionsClientOptionalParams extends ClientOptions { + apiVersion?: string; + cloudSetting?: AzureSupportedClouds; +} + +// @public +export interface ComputeBulkActionsContext extends Client { + apiVersion?: string; + subscriptionId: string; +} + +// @public +export function createComputeBulkActions(credential: TokenCredential, subscriptionId: string, options?: ComputeBulkActionsClientOptionalParams): ComputeBulkActionsContext; + +// (No @packageDocumentation comment for this package) + +``` diff --git a/sdk/computebulkactions/arm-computebulkactions/review/arm-computebulkactions-api-operations-node.api.md b/sdk/computebulkactions/arm-computebulkactions/review/arm-computebulkactions-api-operations-node.api.md new file mode 100644 index 000000000000..b59b9cb84421 --- /dev/null +++ b/sdk/computebulkactions/arm-computebulkactions/review/arm-computebulkactions-api-operations-node.api.md @@ -0,0 +1,19 @@ +## API Report File for "@azure/arm-computebulkactions" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +import type { Client } from '@azure-rest/core-client'; +import type { OperationOptions } from '@azure-rest/core-client'; + +// @public +export function list(context: ComputeBulkActionsContext, options?: OperationsListOptionalParams): PagedAsyncIterableIterator; + +// @public +export interface OperationsListOptionalParams extends OperationOptions { +} + +// (No @packageDocumentation comment for this package) + +``` diff --git a/sdk/computebulkactions/arm-computebulkactions/review/arm-computebulkactions-models-node.api.md b/sdk/computebulkactions/arm-computebulkactions/review/arm-computebulkactions-models-node.api.md new file mode 100644 index 000000000000..da379c5ab6ec --- /dev/null +++ b/sdk/computebulkactions/arm-computebulkactions/review/arm-computebulkactions-models-node.api.md @@ -0,0 +1,1392 @@ +## API Report File for "@azure/arm-computebulkactions" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +// @public +export type AcceleratorManufacturer = string; + +// @public +export type AcceleratorType = string; + +// @public +export type ActionType = string; + +// @public +export interface AdditionalCapabilities { + hibernationEnabled?: boolean; + ultraSSDEnabled?: boolean; +} + +// @public +export interface AdditionalUnattendContent { + componentName?: "Microsoft-Windows-Shell-Setup"; + content?: string; + passName?: "OobeSystem"; + settingName?: SettingNames; +} + +// @public +export interface AllInstancesDown { + automaticallyApprove?: boolean; +} + +// @public +export type AllocationStrategy = string; + +// @public +export interface ApiEntityReference { + id?: string; +} + +// @public +export interface ApiError { + code?: string; + details?: ApiErrorBase[]; + innererror?: InnerError; + message?: string; + target?: string; +} + +// @public +export interface ApiErrorBase { + code?: string; + message?: string; + target?: string; +} + +// @public +export interface ApplicationProfile { + galleryApplications?: VMGalleryApplication[]; +} + +// @public +export type ArchitectureType = string; + +// @public +export interface BootDiagnostics { + enabled?: boolean; + storageUri?: string; +} + +// @public +export type CachingTypes = string; + +// @public +export interface CancelOperationsRequest { + correlationid: string; + operationIds: string[]; +} + +// @public +export interface CancelOperationsResponse { + results: ResourceOperation[]; +} + +// @public +export interface CapacityReservationProfile { + capacityReservationGroup?: SubResource; +} + +// @public +export type CapacityType = string; + +// @public +export interface ComputeProfile { + computeApiVersion?: string; + extensions?: VirtualMachineExtension[]; + virtualMachineProfile: VirtualMachineProfile; +} + +// @public +export type CpuManufacturer = string; + +// @public +export type CreatedByType = string; + +// @public +export interface CreateResourceOperationResponse { + description: string; + location: string; + results?: ResourceOperation[]; + type: string; +} + +// @public +export interface DataDisk { + caching?: CachingTypes; + createOption: DiskCreateOptionTypes; + deleteOption?: DiskDeleteOptionTypes; + detachOption?: DiskDetachOptionTypes; + diskSizeGB?: number; + image?: VirtualHardDisk; + lun: number; + managedDisk?: ManagedDiskParameters; + name?: string; + sourceResource?: ApiEntityReference; + toBeDetached?: boolean; + vhd?: VirtualHardDisk; + writeAcceleratorEnabled?: boolean; +} + +// @public +export type DeadlineType = string; + +// @public +export interface DeallocateResourceOperationResponse { + description: string; + location: string; + results?: ResourceOperation[]; + type: string; +} + +// @public +export type DeleteOptions = string; + +// @public +export interface DeleteResourceOperationResponse { + description: string; + location: string; + results?: ResourceOperation[]; + type: string; +} + +// @public +export interface DiagnosticsProfile { + bootDiagnostics?: BootDiagnostics; +} + +// @public +export type DiffDiskOptions = string; + +// @public +export type DiffDiskPlacement = string; + +// @public +export interface DiffDiskSettings { + option?: DiffDiskOptions; + placement?: DiffDiskPlacement; +} + +// @public +export type DiskControllerTypes = string; + +// @public +export type DiskCreateOptionTypes = string; + +// @public +export type DiskDeleteOptionTypes = string; + +// @public +export type DiskDetachOptionTypes = string; + +// @public +export interface DiskEncryptionSetParameters extends SubResource { +} + +// @public +export interface DiskEncryptionSettings { + diskEncryptionKey?: KeyVaultSecretReference; + enabled?: boolean; + keyEncryptionKey?: KeyVaultKeyReference; +} + +// @public +export type DomainNameLabelScopeTypes = string; + +// @public +export interface EncryptionIdentity { + userAssignedIdentityResourceId?: 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 EventGridAndResourceGraph { + enable?: boolean; + scheduledEventsApiVersion?: string; +} + +// @public +export type EvictionPolicy = string; + +// @public +export interface ExecuteCreateRequest { + correlationid?: string; + executionParameters: ExecutionParameters; + resourceConfigParameters: ResourceProvisionPayload; +} + +// @public +export interface ExecuteDeallocateRequest { + correlationid: string; + executionParameters: ExecutionParameters; + resources?: Resources; +} + +// @public +export interface ExecuteDeleteRequest { + correlationid: string; + executionParameters: ExecutionParameters; + forceDeletion?: boolean; + resources?: Resources; +} + +// @public +export interface ExecuteHibernateRequest { + correlationid: string; + executionParameters: ExecutionParameters; + resources?: Resources; +} + +// @public +export interface ExecuteStartRequest { + correlationid: string; + executionParameters: ExecutionParameters; + resources?: Resources; +} + +// @public +export interface ExecutionParameters { + optimizationPreference?: OptimizationPreference; + retryPolicy?: RetryPolicy; +} + +// @public +export interface GetOperationStatusRequest { + correlationid: string; + operationIds: string[]; +} + +// @public +export interface GetOperationStatusResponse { + results: ResourceOperation[]; +} + +// @public +export interface HibernateResourceOperationResponse { + description: string; + location: string; + results?: ResourceOperation[]; + type: string; +} + +// @public +export interface HostEndpointSettings { + inVMAccessControlProfileReferenceId?: string; + mode?: Modes; +} + +// @public +export type HyperVGeneration = string; + +// @public +export interface ImageReference extends SubResource { + communityGalleryImageId?: string; + offer?: string; + publisher?: string; + sharedGalleryImageId?: string; + sku?: string; + version?: string; +} + +// @public +export interface InnerError { + errorDetail?: string; + exceptionType?: string; +} + +// @public +export type IPVersions = string; + +// @public +export interface KeyVaultKeyReference { + keyUrl: string; + sourceVault: SubResource; +} + +// @public +export interface KeyVaultSecretReference { + secretUrl: string; + sourceVault: SubResource; +} + +// @public +export enum KnownAcceleratorManufacturer { + AMD = "AMD", + Nvidia = "Nvidia", + Xilinx = "Xilinx" +} + +// @public +export enum KnownAcceleratorType { + Fpga = "FPGA", + GPU = "GPU" +} + +// @public +export enum KnownActionType { + Internal = "Internal" +} + +// @public +export enum KnownAllocationStrategy { + CapacityOptimized = "CapacityOptimized", + LowestPrice = "LowestPrice", + Prioritized = "Prioritized" +} + +// @public +export enum KnownArchitectureType { + ARM64 = "ARM64", + X64 = "X64" +} + +// @public +export enum KnownCachingTypes { + None = "None", + ReadOnly = "ReadOnly", + ReadWrite = "ReadWrite" +} + +// @public +export enum KnownCapacityType { + VCpu = "VCpu", + VM = "VM" +} + +// @public +export enum KnownCpuManufacturer { + AMD = "AMD", + Ampere = "Ampere", + Intel = "Intel", + Microsoft = "Microsoft" +} + +// @public +export enum KnownCreatedByType { + Application = "Application", + Key = "Key", + ManagedIdentity = "ManagedIdentity", + User = "User" +} + +// @public +export enum KnownDeadlineType { + CompleteBy = "CompleteBy", + InitiateAt = "InitiateAt", + Unknown = "Unknown" +} + +// @public +export enum KnownDeleteOptions { + Delete = "Delete", + Detach = "Detach" +} + +// @public +export enum KnownDiffDiskOptions { + Local = "Local" +} + +// @public +export enum KnownDiffDiskPlacement { + CacheDisk = "CacheDisk", + NvmeDisk = "NvmeDisk", + ResourceDisk = "ResourceDisk" +} + +// @public +export enum KnownDiskControllerTypes { + NVMe = "NVMe", + Scsi = "SCSI" +} + +// @public +export enum KnownDiskCreateOptionTypes { + Attach = "Attach", + Copy = "Copy", + Empty = "Empty", + FromImage = "FromImage", + Restore = "Restore" +} + +// @public +export enum KnownDiskDeleteOptionTypes { + Delete = "Delete", + Detach = "Detach" +} + +// @public +export enum KnownDiskDetachOptionTypes { + ForceDetach = "ForceDetach" +} + +// @public +export enum KnownDomainNameLabelScopeTypes { + NoReuse = "NoReuse", + ResourceGroupReuse = "ResourceGroupReuse", + SubscriptionReuse = "SubscriptionReuse", + TenantReuse = "TenantReuse" +} + +// @public +export enum KnownEvictionPolicy { + Deallocate = "Deallocate", + Delete = "Delete" +} + +// @public +export enum KnownHyperVGeneration { + Gen1 = "Gen1", + Gen2 = "Gen2" +} + +// @public +export enum KnownIPVersions { + IPv4 = "IPv4", + IPv6 = "IPv6" +} + +// @public +export enum KnownLinuxPatchAssessmentMode { + AutomaticByPlatform = "AutomaticByPlatform", + ImageDefault = "ImageDefault" +} + +// @public +export enum KnownLinuxVMGuestPatchAutomaticByPlatformRebootSetting { + Always = "Always", + IfRequired = "IfRequired", + Never = "Never", + Unknown = "Unknown" +} + +// @public +export enum KnownLinuxVMGuestPatchMode { + AutomaticByPlatform = "AutomaticByPlatform", + ImageDefault = "ImageDefault" +} + +// @public +export enum KnownLocalStorageDiskType { + HDD = "HDD", + SSD = "SSD" +} + +// @public +export enum KnownManagedServiceIdentityType { + None = "None", + SystemAssigned = "SystemAssigned", + SystemAssignedUserAssigned = "SystemAssigned,UserAssigned", + UserAssigned = "UserAssigned" +} + +// @public +export enum KnownMode { + Audit = "Audit", + Enforce = "Enforce" +} + +// @public +export enum KnownModes { + Audit = "Audit", + Disabled = "Disabled", + Enforce = "Enforce" +} + +// @public +export enum KnownNetworkApiVersion { + _20201101 = "2020-11-01", + _20221101 = "2022-11-01" +} + +// @public +export enum KnownNetworkInterfaceAuxiliaryMode { + AcceleratedConnections = "AcceleratedConnections", + Floating = "Floating", + None = "None" +} + +// @public +export enum KnownNetworkInterfaceAuxiliarySku { + A1 = "A1", + A2 = "A2", + A4 = "A4", + A8 = "A8", + None = "None" +} + +// @public +export enum KnownOperatingSystemTypes { + Linux = "Linux", + Windows = "Windows" +} + +// @public +export enum KnownOperationState { + Blocked = "Blocked", + Cancelled = "Cancelled", + Executing = "Executing", + Failed = "Failed", + PendingExecution = "PendingExecution", + PendingScheduling = "PendingScheduling", + Scheduled = "Scheduled", + Succeeded = "Succeeded", + Unknown = "Unknown" +} + +// @public +export enum KnownOptimizationPreference { + Availability = "Availability", + Cost = "Cost", + CostAvailabilityBalanced = "CostAvailabilityBalanced" +} + +// @public +export enum KnownOrigin { + System = "system", + User = "user", + UserSystem = "user,system" +} + +// @public +export enum KnownProtocolTypes { + Http = "Http", + Https = "Https" +} + +// @public +export enum KnownProvisioningState { + Canceled = "Canceled", + Creating = "Creating", + Deleting = "Deleting", + Failed = "Failed", + Succeeded = "Succeeded" +} + +// @public +export enum KnownPublicIPAddressSkuName { + Basic = "Basic", + Standard = "Standard" +} + +// @public +export enum KnownPublicIPAddressSkuTier { + Global = "Global", + Regional = "Regional" +} + +// @public +export enum KnownPublicIPAllocationMethod { + Dynamic = "Dynamic", + Static = "Static" +} + +// @public +export enum KnownResourceOperationType { + Create = "Create", + Deallocate = "Deallocate", + Delete = "Delete", + Hibernate = "Hibernate", + Start = "Start", + Unknown = "Unknown" +} + +// @public +export enum KnownSecurityEncryptionTypes { + DiskWithVMGuestState = "DiskWithVMGuestState", + NonPersistedTPM = "NonPersistedTPM", + VMGuestStateOnly = "VMGuestStateOnly" +} + +// @public +export enum KnownSecurityTypes { + ConfidentialVM = "ConfidentialVM", + TrustedLaunch = "TrustedLaunch" +} + +// @public +export enum KnownSettingNames { + AutoLogon = "AutoLogon", + FirstLogonCommands = "FirstLogonCommands" +} + +// @public +export enum KnownStorageAccountTypes { + PremiumLRS = "Premium_LRS", + PremiumV2LRS = "PremiumV2_LRS", + PremiumZRS = "Premium_ZRS", + StandardLRS = "Standard_LRS", + StandardSSDLRS = "StandardSSD_LRS", + StandardSSDZRS = "StandardSSD_ZRS", + UltraSSDLRS = "UltraSSD_LRS" +} + +// @public +export enum KnownVersions { + _20260201Preview = "2026-02-01-preview" +} + +// @public +export enum KnownVirtualMachineType { + Regular = "Regular", + Spot = "Spot" +} + +// @public +export enum KnownVMAttributeSupport { + Excluded = "Excluded", + Included = "Included", + Required = "Required" +} + +// @public +export enum KnownVMCategory { + ComputeOptimized = "ComputeOptimized", + FpgaAccelerated = "FpgaAccelerated", + GeneralPurpose = "GeneralPurpose", + GpuAccelerated = "GpuAccelerated", + HighPerformanceCompute = "HighPerformanceCompute", + MemoryOptimized = "MemoryOptimized", + StorageOptimized = "StorageOptimized" +} + +// @public +export enum KnownVMOperationStatus { + Canceled = "Canceled", + CancelFailedStatusUnknown = "CancelFailedStatusUnknown", + Cancelling = "Cancelling", + Creating = "Creating", + Deleting = "Deleting", + Failed = "Failed", + Succeeded = "Succeeded" +} + +// @public +export enum KnownWindowsPatchAssessmentMode { + AutomaticByPlatform = "AutomaticByPlatform", + ImageDefault = "ImageDefault" +} + +// @public +export enum KnownWindowsVMGuestPatchAutomaticByPlatformRebootSetting { + Always = "Always", + IfRequired = "IfRequired", + Never = "Never", + Unknown = "Unknown" +} + +// @public +export enum KnownWindowsVMGuestPatchMode { + AutomaticByOS = "AutomaticByOS", + AutomaticByPlatform = "AutomaticByPlatform", + Manual = "Manual" +} + +// @public +export enum KnownZoneDistributionStrategy { + BestEffortBalanced = "BestEffortBalanced", + BestEffortSingleZone = "BestEffortSingleZone", + Prioritized = "Prioritized", + StrictBalanced = "StrictBalanced" +} + +// @public +export interface LaunchBulkInstancesOperationProperties { + capacity: number; + capacityType?: CapacityType; + computeProfile: ComputeProfile; + priorityProfile: PriorityProfile; + readonly provisioningState?: ProvisioningState; + retryPolicy?: RetryPolicy; + vmAttributes?: VMAttributes; + vmSizesProfile?: VmSizeProfile[]; + zoneAllocationPolicy?: ZoneAllocationPolicy; +} + +// @public +export interface LinuxConfiguration { + disablePasswordAuthentication?: boolean; + enableVMAgentPlatformUpdates?: boolean; + patchSettings?: LinuxPatchSettings; + provisionVMAgent?: boolean; + ssh?: SshConfiguration; +} + +// @public +export type LinuxPatchAssessmentMode = string; + +// @public +export interface LinuxPatchSettings { + assessmentMode?: LinuxPatchAssessmentMode; + automaticByPlatformSettings?: LinuxVMGuestPatchAutomaticByPlatformSettings; + patchMode?: LinuxVMGuestPatchMode; +} + +// @public +export type LinuxVMGuestPatchAutomaticByPlatformRebootSetting = string; + +// @public +export interface LinuxVMGuestPatchAutomaticByPlatformSettings { + bypassPlatformSafetyChecksOnUserSchedule?: boolean; + rebootSetting?: LinuxVMGuestPatchAutomaticByPlatformRebootSetting; +} + +// @public +export type LinuxVMGuestPatchMode = string; + +// @public +export type LocalStorageDiskType = string; + +// @public +export interface LocationBasedLaunchBulkInstancesOperation extends ProxyResource { + identity?: ManagedServiceIdentity; + plan?: Plan; + properties?: LaunchBulkInstancesOperationProperties; + tags?: Record; + zones?: string[]; +} + +// @public +export interface ManagedDiskParameters extends SubResource { + diskEncryptionSet?: DiskEncryptionSetParameters; + securityProfile?: VMDiskSecurityProfile; + storageAccountType?: StorageAccountTypes; +} + +// @public +export interface ManagedServiceIdentity { + readonly principalId?: string; + readonly tenantId?: string; + type: ManagedServiceIdentityType; + userAssignedIdentities?: Record; +} + +// @public +export type ManagedServiceIdentityType = string; + +// @public +export type Mode = string; + +// @public +export type Modes = string; + +// @public +export type NetworkApiVersion = string; + +// @public +export type NetworkInterfaceAuxiliaryMode = string; + +// @public +export type NetworkInterfaceAuxiliarySku = string; + +// @public +export interface NetworkInterfaceReference extends SubResource { + properties?: NetworkInterfaceReferenceProperties; +} + +// @public +export interface NetworkInterfaceReferenceProperties { + deleteOption?: DeleteOptions; + primary?: boolean; +} + +// @public +export interface NetworkProfile { + networkApiVersion?: NetworkApiVersion; + networkInterfaceConfigurations?: VirtualMachineNetworkInterfaceConfiguration[]; + networkInterfaces?: NetworkInterfaceReference[]; +} + +// @public +export type OperatingSystemTypes = string; + +// @public +export interface Operation { + readonly actionType?: ActionType; + display?: OperationDisplay; + readonly isDataAction?: boolean; + readonly name?: string; + readonly origin?: Origin; +} + +// @public +export interface OperationDisplay { + readonly description?: string; + readonly operation?: string; + readonly provider?: string; + readonly resource?: string; +} + +// @public +export type OperationState = string; + +// @public +export interface OperationStatusResult { + endTime?: Date; + error?: ErrorDetail; + id?: string; + name?: string; + operations?: OperationStatusResult[]; + percentComplete?: number; + readonly resourceId?: string; + startTime?: Date; + status: string; +} + +// @public +export type OptimizationPreference = string; + +// @public +export type Origin = string; + +// @public +export interface OSDisk { + caching?: CachingTypes; + createOption: DiskCreateOptionTypes; + deleteOption?: DiskDeleteOptionTypes; + diffDiskSettings?: DiffDiskSettings; + diskSizeGB?: number; + encryptionSettings?: DiskEncryptionSettings; + image?: VirtualHardDisk; + managedDisk?: ManagedDiskParameters; + name?: string; + osType?: OperatingSystemTypes; + vhd?: VirtualHardDisk; + writeAcceleratorEnabled?: boolean; +} + +// @public +export interface OSImageNotificationProfile { + enable?: boolean; + notBeforeTimeout?: string; +} + +// @public +export interface OSProfile { + adminPassword?: string; + adminUsername?: string; + allowExtensionOperations?: boolean; + computerName?: string; + customData?: string; + linuxConfiguration?: LinuxConfiguration; + requireGuestProvisionSignal?: boolean; + secrets?: VaultSecretGroup[]; + windowsConfiguration?: WindowsConfiguration; +} + +// @public +export interface PatchSettings { + assessmentMode?: WindowsPatchAssessmentMode; + automaticByPlatformSettings?: WindowsVMGuestPatchAutomaticByPlatformSettings; + enableHotpatching?: boolean; + patchMode?: WindowsVMGuestPatchMode; +} + +// @public +export interface Plan { + name: string; + product: string; + promotionCode?: string; + publisher: string; + version?: string; +} + +// @public +export interface PriorityProfile { + allocationStrategy?: AllocationStrategy; + evictionPolicy?: EvictionPolicy; + maxPricePerVM?: number; + type?: VirtualMachineType; +} + +// @public +export type ProtocolTypes = string; + +// @public +export type ProvisioningState = string; + +// @public +export interface ProxyAgentSettings { + addProxyAgentExtension?: boolean; + enabled?: boolean; + imds?: HostEndpointSettings; + keyIncarnationId?: number; + mode?: Mode; + wireServer?: HostEndpointSettings; +} + +// @public +export interface ProxyResource extends Resource { +} + +// @public +export interface PublicIPAddressSku { + name?: PublicIPAddressSkuName; + tier?: PublicIPAddressSkuTier; +} + +// @public +export type PublicIPAddressSkuName = string; + +// @public +export type PublicIPAddressSkuTier = string; + +// @public +export type PublicIPAllocationMethod = string; + +// @public +export interface Resource { + readonly id?: string; + readonly name?: string; + readonly systemData?: SystemData; + readonly type?: string; +} + +// @public +export interface ResourceOperation { + errorCode?: string; + errorDetails?: string; + operation?: ResourceOperationDetails; + resourceId?: string; +} + +// @public +export interface ResourceOperationDetails { + completedAt?: string; + deadline?: string; + deadlineType?: DeadlineType; + operationId: string; + opType?: ResourceOperationType; + resourceId?: string; + resourceOperationError?: ResourceOperationError; + retryPolicy?: RetryPolicy; + state?: OperationState; + subscriptionId?: string; + timezone?: string; +} + +// @public +export interface ResourceOperationError { + errorCode: string; + errorDetails: string; +} + +// @public +export type ResourceOperationType = string; + +// @public +export interface ResourceProvisionPayload { + baseProfile?: Record; + resourceCount: number; + resourceOverrides?: Record[]; + resourcePrefix?: string; +} + +// @public +export interface Resources { + ids: string[]; +} + +// @public +export interface RetryPolicy { + retryCount?: number; + retryWindowInMinutes?: number; +} + +// @public +export interface ScheduledEventsAdditionalPublishingTargets { + eventGridAndResourceGraph?: EventGridAndResourceGraph; +} + +// @public +export interface ScheduledEventsPolicy { + allInstancesDown?: AllInstancesDown; + scheduledEventsAdditionalPublishingTargets?: ScheduledEventsAdditionalPublishingTargets; + userInitiatedReboot?: UserInitiatedReboot; + userInitiatedRedeploy?: UserInitiatedRedeploy; +} + +// @public +export interface ScheduledEventsProfile { + osImageNotificationProfile?: OSImageNotificationProfile; + terminateNotificationProfile?: TerminateNotificationProfile; +} + +// @public +export type SecurityEncryptionTypes = string; + +// @public +export interface SecurityProfile { + encryptionAtHost?: boolean; + encryptionIdentity?: EncryptionIdentity; + proxyAgentSettings?: ProxyAgentSettings; + securityType?: SecurityTypes; + uefiSettings?: UefiSettings; +} + +// @public +export type SecurityTypes = string; + +// @public +export type SettingNames = string; + +// @public +export interface SshConfiguration { + publicKeys?: SshPublicKey[]; +} + +// @public +export interface SshPublicKey { + keyData?: string; + path?: string; +} + +// @public +export interface StartResourceOperationResponse { + description: string; + location: string; + results?: ResourceOperation[]; + type: string; +} + +// @public +export type StorageAccountTypes = string; + +// @public +export interface StorageProfile { + dataDisks?: DataDisk[]; + diskControllerType?: DiskControllerTypes; + imageReference?: ImageReference; + osDisk?: OSDisk; +} + +// @public +export interface SubResource { + id?: string; +} + +// @public +export interface SystemData { + createdAt?: Date; + createdBy?: string; + createdByType?: CreatedByType; + lastModifiedAt?: Date; + lastModifiedBy?: string; + lastModifiedByType?: CreatedByType; +} + +// @public +export interface TerminateNotificationProfile { + enable?: boolean; + notBeforeTimeout?: string; +} + +// @public +export interface UefiSettings { + secureBootEnabled?: boolean; + vTpmEnabled?: boolean; +} + +// @public +export interface UserAssignedIdentity { + readonly clientId?: string; + readonly principalId?: string; +} + +// @public +export interface UserInitiatedReboot { + automaticallyApprove?: boolean; +} + +// @public +export interface UserInitiatedRedeploy { + automaticallyApprove?: boolean; +} + +// @public +export interface VaultCertificate { + certificateStore?: string; + certificateUrl?: string; +} + +// @public +export interface VaultSecretGroup { + sourceVault?: SubResource; + vaultCertificates?: VaultCertificate[]; +} + +// @public +export interface VirtualHardDisk { + uri?: string; +} + +// @public +export interface VirtualMachine { + readonly error?: ApiError; + readonly id: string; + readonly name: string; + readonly operationStatus: VMOperationStatus; + readonly type?: string; +} + +// @public +export interface VirtualMachineExtension { + name: string; + properties: VirtualMachineExtensionProperties; +} + +// @public +export interface VirtualMachineExtensionProperties { + autoUpgradeMinorVersion?: boolean; + enableAutomaticUpgrade?: boolean; + forceUpdateTag?: string; + protectedSettings?: Record; + protectedSettingsFromKeyVault?: KeyVaultSecretReference; + provisionAfterExtensions?: string[]; + publisher?: string; + settings?: Record; + suppressFailures?: boolean; + type?: string; + typeHandlerVersion?: string; +} + +// @public +export interface VirtualMachineIpTag { + ipTagType?: string; + tag?: string; +} + +// @public +export interface VirtualMachineNetworkInterfaceConfiguration { + name: string; + properties?: VirtualMachineNetworkInterfaceConfigurationProperties; + tags?: Record; +} + +// @public +export interface VirtualMachineNetworkInterfaceConfigurationProperties { + auxiliaryMode?: NetworkInterfaceAuxiliaryMode; + auxiliarySku?: NetworkInterfaceAuxiliarySku; + deleteOption?: DeleteOptions; + disableTcpStateTracking?: boolean; + dnsSettings?: VirtualMachineNetworkInterfaceDnsSettingsConfiguration; + dscpConfiguration?: SubResource; + enableAcceleratedNetworking?: boolean; + enableFpga?: boolean; + enableIPForwarding?: boolean; + ipConfigurations: VirtualMachineNetworkInterfaceIPConfiguration[]; + networkSecurityGroup?: SubResource; + primary?: boolean; +} + +// @public +export interface VirtualMachineNetworkInterfaceDnsSettingsConfiguration { + dnsServers?: string[]; +} + +// @public +export interface VirtualMachineNetworkInterfaceIPConfiguration { + name: string; + properties?: VirtualMachineNetworkInterfaceIPConfigurationProperties; +} + +// @public +export interface VirtualMachineNetworkInterfaceIPConfigurationProperties { + applicationGatewayBackendAddressPools?: SubResource[]; + applicationSecurityGroups?: SubResource[]; + loadBalancerBackendAddressPools?: SubResource[]; + primary?: boolean; + privateIPAddressVersion?: IPVersions; + publicIPAddressConfiguration?: VirtualMachinePublicIPAddressConfiguration; + subnet?: SubResource; +} + +// @public +export interface VirtualMachineProfile { + additionalCapabilities?: AdditionalCapabilities; + applicationProfile?: ApplicationProfile; + capacityReservation?: CapacityReservationProfile; + diagnosticsProfile?: DiagnosticsProfile; + extensionsTimeBudget?: string; + licenseType?: string; + networkProfile?: NetworkProfile; + osProfile?: OSProfile; + scheduledEventsPolicy?: ScheduledEventsPolicy; + scheduledEventsProfile?: ScheduledEventsProfile; + securityProfile?: SecurityProfile; + storageProfile?: StorageProfile; + userData?: string; +} + +// @public +export interface VirtualMachinePublicIPAddressConfiguration { + name: string; + properties?: VirtualMachinePublicIPAddressConfigurationProperties; + sku?: PublicIPAddressSku; + tags?: Record; +} + +// @public +export interface VirtualMachinePublicIPAddressConfigurationProperties { + deleteOption?: DeleteOptions; + dnsSettings?: VirtualMachinePublicIPAddressDnsSettingsConfiguration; + idleTimeoutInMinutes?: number; + ipTags?: VirtualMachineIpTag[]; + publicIPAddressVersion?: IPVersions; + publicIPAllocationMethod?: PublicIPAllocationMethod; + publicIPPrefix?: SubResource; +} + +// @public +export interface VirtualMachinePublicIPAddressDnsSettingsConfiguration { + domainNameLabel: string; + domainNameLabelScope?: DomainNameLabelScopeTypes; +} + +// @public +export type VirtualMachineType = string; + +// @public +export interface VMAttributeMinMaxDouble { + max?: number; + min?: number; +} + +// @public +export interface VMAttributeMinMaxInteger { + max?: number; + min?: number; +} + +// @public +export interface VMAttributes { + acceleratorCount?: VMAttributeMinMaxInteger; + acceleratorManufacturers?: AcceleratorManufacturer[]; + acceleratorSupport?: VMAttributeSupport; + acceleratorTypes?: AcceleratorType[]; + allowedVMSizes?: string[]; + architectureTypes: ArchitectureType[]; + burstableSupport?: VMAttributeSupport; + cpuManufacturers?: CpuManufacturer[]; + dataDiskCount?: VMAttributeMinMaxInteger; + excludedVMSizes?: string[]; + hyperVGenerations?: HyperVGeneration[]; + localStorageDiskTypes?: LocalStorageDiskType[]; + localStorageInGiB?: VMAttributeMinMaxDouble; + localStorageSupport?: VMAttributeSupport; + memoryInGiB: VMAttributeMinMaxDouble; + memoryInGiBPerVCpu?: VMAttributeMinMaxDouble; + networkBandwidthInMbps?: VMAttributeMinMaxDouble; + networkInterfaceCount?: VMAttributeMinMaxInteger; + rdmaNetworkInterfaceCount?: VMAttributeMinMaxInteger; + rdmaSupport?: VMAttributeSupport; + vCpuCount: VMAttributeMinMaxInteger; + vmCategories?: VMCategory[]; +} + +// @public +export type VMAttributeSupport = string; + +// @public +export type VMCategory = string; + +// @public +export interface VMDiskSecurityProfile { + diskEncryptionSet?: DiskEncryptionSetParameters; + securityEncryptionType?: SecurityEncryptionTypes; +} + +// @public +export interface VMGalleryApplication { + configurationReference?: string; + enableAutomaticUpgrade?: boolean; + order?: number; + packageReferenceId: string; + tags?: string; + treatFailureAsDeploymentFailure?: boolean; +} + +// @public +export type VMOperationStatus = string; + +// @public +export interface VmSizeProfile { + name: string; + rank?: number; +} + +// @public +export interface WindowsConfiguration { + additionalUnattendContent?: AdditionalUnattendContent[]; + enableAutomaticUpdates?: boolean; + patchSettings?: PatchSettings; + provisionVMAgent?: boolean; + timeZone?: string; + winRM?: WinRMConfiguration; +} + +// @public +export type WindowsPatchAssessmentMode = string; + +// @public +export type WindowsVMGuestPatchAutomaticByPlatformRebootSetting = string; + +// @public +export interface WindowsVMGuestPatchAutomaticByPlatformSettings { + bypassPlatformSafetyChecksOnUserSchedule?: boolean; + rebootSetting?: WindowsVMGuestPatchAutomaticByPlatformRebootSetting; +} + +// @public +export type WindowsVMGuestPatchMode = string; + +// @public +export interface WinRMConfiguration { + listeners?: WinRMListener[]; +} + +// @public +export interface WinRMListener { + certificateUrl?: string; + protocol?: ProtocolTypes; +} + +// @public +export interface ZoneAllocationPolicy { + distributionStrategy: ZoneDistributionStrategy; + zonePreferences?: ZonePreference[]; +} + +// @public +export type ZoneDistributionStrategy = string; + +// @public +export interface ZonePreference { + rank?: number; + zone: string; +} + +// (No @packageDocumentation comment for this package) + +``` diff --git a/sdk/computebulkactions/arm-computebulkactions/review/arm-computebulkactions-node.api.md b/sdk/computebulkactions/arm-computebulkactions/review/arm-computebulkactions-node.api.md new file mode 100644 index 000000000000..222210e598e9 --- /dev/null +++ b/sdk/computebulkactions/arm-computebulkactions/review/arm-computebulkactions-node.api.md @@ -0,0 +1,1546 @@ +## API Report File for "@azure/arm-computebulkactions" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +import type { AbortSignalLike } from '@azure/abort-controller'; +import type { ClientOptions } from '@azure-rest/core-client'; +import type { OperationOptions } from '@azure-rest/core-client'; +import type { OperationState as OperationState_2 } from '@azure/core-lro'; +import type { PathUncheckedResponse } from '@azure-rest/core-client'; +import type { Pipeline } from '@azure/core-rest-pipeline'; +import type { PollerLike } from '@azure/core-lro'; +import type { TokenCredential } from '@azure/core-auth'; + +// @public +export type AcceleratorManufacturer = string; + +// @public +export type AcceleratorType = string; + +// @public +export type ActionType = string; + +// @public +export interface AdditionalCapabilities { + hibernationEnabled?: boolean; + ultraSSDEnabled?: boolean; +} + +// @public +export interface AdditionalUnattendContent { + componentName?: "Microsoft-Windows-Shell-Setup"; + content?: string; + passName?: "OobeSystem"; + settingName?: SettingNames; +} + +// @public +export interface AllInstancesDown { + automaticallyApprove?: boolean; +} + +// @public +export type AllocationStrategy = string; + +// @public +export interface ApiEntityReference { + id?: string; +} + +// @public +export interface ApiError { + code?: string; + details?: ApiErrorBase[]; + innererror?: InnerError; + message?: string; + target?: string; +} + +// @public +export interface ApiErrorBase { + code?: string; + message?: string; + target?: string; +} + +// @public +export interface ApplicationProfile { + galleryApplications?: VMGalleryApplication[]; +} + +// @public +export type ArchitectureType = string; + +// @public +export enum AzureClouds { + AZURE_CHINA_CLOUD = "AZURE_CHINA_CLOUD", + AZURE_PUBLIC_CLOUD = "AZURE_PUBLIC_CLOUD", + AZURE_US_GOVERNMENT = "AZURE_US_GOVERNMENT" +} + +// @public +export type AzureSupportedClouds = `${AzureClouds}`; + +// @public +export interface BootDiagnostics { + enabled?: boolean; + storageUri?: string; +} + +// @public +export interface BulkActionsCancelOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface BulkActionsCreateOrUpdateOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface BulkActionsDeleteOptionalParams extends OperationOptions { + deleteInstances?: boolean; + updateIntervalInMs?: number; +} + +// @public +export interface BulkActionsGetOperationStatusOptionalParams extends OperationOptions { +} + +// @public +export interface BulkActionsGetOptionalParams extends OperationOptions { +} + +// @public +export interface BulkActionsListByResourceGroupOptionalParams extends OperationOptions { +} + +// @public +export interface BulkActionsListBySubscriptionOptionalParams extends OperationOptions { +} + +// @public +export interface BulkActionsListVirtualMachinesOptionalParams extends OperationOptions { + filter?: string; + skiptoken?: string; +} + +// @public +export interface BulkActionsOperations { + cancel: (resourceGroupName: string, location: string, name: string, options?: BulkActionsCancelOptionalParams) => PollerLike, void>; + createOrUpdate: (resourceGroupName: string, location: string, name: string, resource: LocationBasedLaunchBulkInstancesOperation, options?: BulkActionsCreateOrUpdateOptionalParams) => PollerLike, LocationBasedLaunchBulkInstancesOperation>; + delete: (resourceGroupName: string, location: string, name: string, options?: BulkActionsDeleteOptionalParams) => PollerLike, void>; + get: (resourceGroupName: string, location: string, name: string, options?: BulkActionsGetOptionalParams) => Promise; + getOperationStatus: (location: string, id: string, options?: BulkActionsGetOperationStatusOptionalParams) => Promise; + listByResourceGroup: (resourceGroupName: string, location: string, options?: BulkActionsListByResourceGroupOptionalParams) => PagedAsyncIterableIterator; + listBySubscription: (location: string, options?: BulkActionsListBySubscriptionOptionalParams) => PagedAsyncIterableIterator; + listVirtualMachines: (resourceGroupName: string, location: string, name: string, options?: BulkActionsListVirtualMachinesOptionalParams) => PagedAsyncIterableIterator; + virtualMachinesCancelOperations: (location: string, requestBody: CancelOperationsRequest, options?: BulkActionsVirtualMachinesCancelOperationsOptionalParams) => Promise; + virtualMachinesExecuteCreate: (location: string, requestBody: ExecuteCreateRequest, options?: BulkActionsVirtualMachinesExecuteCreateOptionalParams) => Promise; + virtualMachinesExecuteDeallocate: (location: string, requestBody: ExecuteDeallocateRequest, options?: BulkActionsVirtualMachinesExecuteDeallocateOptionalParams) => Promise; + virtualMachinesExecuteDelete: (location: string, requestBody: ExecuteDeleteRequest, options?: BulkActionsVirtualMachinesExecuteDeleteOptionalParams) => Promise; + virtualMachinesExecuteHibernate: (location: string, requestBody: ExecuteHibernateRequest, options?: BulkActionsVirtualMachinesExecuteHibernateOptionalParams) => Promise; + virtualMachinesExecuteStart: (location: string, requestBody: ExecuteStartRequest, options?: BulkActionsVirtualMachinesExecuteStartOptionalParams) => Promise; + virtualMachinesGetOperationStatus: (location: string, requestBody: GetOperationStatusRequest, options?: BulkActionsVirtualMachinesGetOperationStatusOptionalParams) => Promise; +} + +// @public +export interface BulkActionsVirtualMachinesCancelOperationsOptionalParams extends OperationOptions { +} + +// @public +export interface BulkActionsVirtualMachinesExecuteCreateOptionalParams extends OperationOptions { +} + +// @public +export interface BulkActionsVirtualMachinesExecuteDeallocateOptionalParams extends OperationOptions { +} + +// @public +export interface BulkActionsVirtualMachinesExecuteDeleteOptionalParams extends OperationOptions { +} + +// @public +export interface BulkActionsVirtualMachinesExecuteHibernateOptionalParams extends OperationOptions { +} + +// @public +export interface BulkActionsVirtualMachinesExecuteStartOptionalParams extends OperationOptions { +} + +// @public +export interface BulkActionsVirtualMachinesGetOperationStatusOptionalParams extends OperationOptions { +} + +// @public +export type CachingTypes = string; + +// @public +export interface CancelOperationsRequest { + correlationid: string; + operationIds: string[]; +} + +// @public +export interface CancelOperationsResponse { + results: ResourceOperation[]; +} + +// @public +export interface CapacityReservationProfile { + capacityReservationGroup?: SubResource; +} + +// @public +export type CapacityType = string; + +// @public (undocumented) +export class ComputeBulkActionsClient { + constructor(credential: TokenCredential, subscriptionId: string, options?: ComputeBulkActionsClientOptionalParams); + readonly bulkActions: BulkActionsOperations; + readonly operations: OperationsOperations; + readonly pipeline: Pipeline; +} + +// @public +export interface ComputeBulkActionsClientOptionalParams extends ClientOptions { + apiVersion?: string; + cloudSetting?: AzureSupportedClouds; +} + +// @public +export interface ComputeProfile { + computeApiVersion?: string; + extensions?: VirtualMachineExtension[]; + virtualMachineProfile: VirtualMachineProfile; +} + +// @public +export type ContinuablePage = TPage & { + continuationToken?: string; +}; + +// @public +export type CpuManufacturer = string; + +// @public +export type CreatedByType = string; + +// @public +export interface CreateResourceOperationResponse { + description: string; + location: string; + results?: ResourceOperation[]; + type: string; +} + +// @public +export interface DataDisk { + caching?: CachingTypes; + createOption: DiskCreateOptionTypes; + deleteOption?: DiskDeleteOptionTypes; + detachOption?: DiskDetachOptionTypes; + diskSizeGB?: number; + image?: VirtualHardDisk; + lun: number; + managedDisk?: ManagedDiskParameters; + name?: string; + sourceResource?: ApiEntityReference; + toBeDetached?: boolean; + vhd?: VirtualHardDisk; + writeAcceleratorEnabled?: boolean; +} + +// @public +export type DeadlineType = string; + +// @public +export interface DeallocateResourceOperationResponse { + description: string; + location: string; + results?: ResourceOperation[]; + type: string; +} + +// @public +export type DeleteOptions = string; + +// @public +export interface DeleteResourceOperationResponse { + description: string; + location: string; + results?: ResourceOperation[]; + type: string; +} + +// @public +export interface DiagnosticsProfile { + bootDiagnostics?: BootDiagnostics; +} + +// @public +export type DiffDiskOptions = string; + +// @public +export type DiffDiskPlacement = string; + +// @public +export interface DiffDiskSettings { + option?: DiffDiskOptions; + placement?: DiffDiskPlacement; +} + +// @public +export type DiskControllerTypes = string; + +// @public +export type DiskCreateOptionTypes = string; + +// @public +export type DiskDeleteOptionTypes = string; + +// @public +export type DiskDetachOptionTypes = string; + +// @public +export interface DiskEncryptionSetParameters extends SubResource { +} + +// @public +export interface DiskEncryptionSettings { + diskEncryptionKey?: KeyVaultSecretReference; + enabled?: boolean; + keyEncryptionKey?: KeyVaultKeyReference; +} + +// @public +export type DomainNameLabelScopeTypes = string; + +// @public +export interface EncryptionIdentity { + userAssignedIdentityResourceId?: 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 EventGridAndResourceGraph { + enable?: boolean; + scheduledEventsApiVersion?: string; +} + +// @public +export type EvictionPolicy = string; + +// @public +export interface ExecuteCreateRequest { + correlationid?: string; + executionParameters: ExecutionParameters; + resourceConfigParameters: ResourceProvisionPayload; +} + +// @public +export interface ExecuteDeallocateRequest { + correlationid: string; + executionParameters: ExecutionParameters; + resources?: Resources; +} + +// @public +export interface ExecuteDeleteRequest { + correlationid: string; + executionParameters: ExecutionParameters; + forceDeletion?: boolean; + resources?: Resources; +} + +// @public +export interface ExecuteHibernateRequest { + correlationid: string; + executionParameters: ExecutionParameters; + resources?: Resources; +} + +// @public +export interface ExecuteStartRequest { + correlationid: string; + executionParameters: ExecutionParameters; + resources?: Resources; +} + +// @public +export interface ExecutionParameters { + optimizationPreference?: OptimizationPreference; + retryPolicy?: RetryPolicy; +} + +// @public +export interface GetOperationStatusRequest { + correlationid: string; + operationIds: string[]; +} + +// @public +export interface GetOperationStatusResponse { + results: ResourceOperation[]; +} + +// @public +export interface HibernateResourceOperationResponse { + description: string; + location: string; + results?: ResourceOperation[]; + type: string; +} + +// @public +export interface HostEndpointSettings { + inVMAccessControlProfileReferenceId?: string; + mode?: Modes; +} + +// @public +export type HyperVGeneration = string; + +// @public +export interface ImageReference extends SubResource { + communityGalleryImageId?: string; + offer?: string; + publisher?: string; + sharedGalleryImageId?: string; + sku?: string; + version?: string; +} + +// @public +export interface InnerError { + errorDetail?: string; + exceptionType?: string; +} + +// @public +export type IPVersions = string; + +// @public +export interface KeyVaultKeyReference { + keyUrl: string; + sourceVault: SubResource; +} + +// @public +export interface KeyVaultSecretReference { + secretUrl: string; + sourceVault: SubResource; +} + +// @public +export enum KnownAcceleratorManufacturer { + AMD = "AMD", + Nvidia = "Nvidia", + Xilinx = "Xilinx" +} + +// @public +export enum KnownAcceleratorType { + Fpga = "FPGA", + GPU = "GPU" +} + +// @public +export enum KnownActionType { + Internal = "Internal" +} + +// @public +export enum KnownAllocationStrategy { + CapacityOptimized = "CapacityOptimized", + LowestPrice = "LowestPrice", + Prioritized = "Prioritized" +} + +// @public +export enum KnownArchitectureType { + ARM64 = "ARM64", + X64 = "X64" +} + +// @public +export enum KnownCachingTypes { + None = "None", + ReadOnly = "ReadOnly", + ReadWrite = "ReadWrite" +} + +// @public +export enum KnownCapacityType { + VCpu = "VCpu", + VM = "VM" +} + +// @public +export enum KnownCpuManufacturer { + AMD = "AMD", + Ampere = "Ampere", + Intel = "Intel", + Microsoft = "Microsoft" +} + +// @public +export enum KnownCreatedByType { + Application = "Application", + Key = "Key", + ManagedIdentity = "ManagedIdentity", + User = "User" +} + +// @public +export enum KnownDeadlineType { + CompleteBy = "CompleteBy", + InitiateAt = "InitiateAt", + Unknown = "Unknown" +} + +// @public +export enum KnownDeleteOptions { + Delete = "Delete", + Detach = "Detach" +} + +// @public +export enum KnownDiffDiskOptions { + Local = "Local" +} + +// @public +export enum KnownDiffDiskPlacement { + CacheDisk = "CacheDisk", + NvmeDisk = "NvmeDisk", + ResourceDisk = "ResourceDisk" +} + +// @public +export enum KnownDiskControllerTypes { + NVMe = "NVMe", + Scsi = "SCSI" +} + +// @public +export enum KnownDiskCreateOptionTypes { + Attach = "Attach", + Copy = "Copy", + Empty = "Empty", + FromImage = "FromImage", + Restore = "Restore" +} + +// @public +export enum KnownDiskDeleteOptionTypes { + Delete = "Delete", + Detach = "Detach" +} + +// @public +export enum KnownDiskDetachOptionTypes { + ForceDetach = "ForceDetach" +} + +// @public +export enum KnownDomainNameLabelScopeTypes { + NoReuse = "NoReuse", + ResourceGroupReuse = "ResourceGroupReuse", + SubscriptionReuse = "SubscriptionReuse", + TenantReuse = "TenantReuse" +} + +// @public +export enum KnownEvictionPolicy { + Deallocate = "Deallocate", + Delete = "Delete" +} + +// @public +export enum KnownHyperVGeneration { + Gen1 = "Gen1", + Gen2 = "Gen2" +} + +// @public +export enum KnownIPVersions { + IPv4 = "IPv4", + IPv6 = "IPv6" +} + +// @public +export enum KnownLinuxPatchAssessmentMode { + AutomaticByPlatform = "AutomaticByPlatform", + ImageDefault = "ImageDefault" +} + +// @public +export enum KnownLinuxVMGuestPatchAutomaticByPlatformRebootSetting { + Always = "Always", + IfRequired = "IfRequired", + Never = "Never", + Unknown = "Unknown" +} + +// @public +export enum KnownLinuxVMGuestPatchMode { + AutomaticByPlatform = "AutomaticByPlatform", + ImageDefault = "ImageDefault" +} + +// @public +export enum KnownLocalStorageDiskType { + HDD = "HDD", + SSD = "SSD" +} + +// @public +export enum KnownManagedServiceIdentityType { + None = "None", + SystemAssigned = "SystemAssigned", + SystemAssignedUserAssigned = "SystemAssigned,UserAssigned", + UserAssigned = "UserAssigned" +} + +// @public +export enum KnownMode { + Audit = "Audit", + Enforce = "Enforce" +} + +// @public +export enum KnownModes { + Audit = "Audit", + Disabled = "Disabled", + Enforce = "Enforce" +} + +// @public +export enum KnownNetworkApiVersion { + _20201101 = "2020-11-01", + _20221101 = "2022-11-01" +} + +// @public +export enum KnownNetworkInterfaceAuxiliaryMode { + AcceleratedConnections = "AcceleratedConnections", + Floating = "Floating", + None = "None" +} + +// @public +export enum KnownNetworkInterfaceAuxiliarySku { + A1 = "A1", + A2 = "A2", + A4 = "A4", + A8 = "A8", + None = "None" +} + +// @public +export enum KnownOperatingSystemTypes { + Linux = "Linux", + Windows = "Windows" +} + +// @public +export enum KnownOperationState { + Blocked = "Blocked", + Cancelled = "Cancelled", + Executing = "Executing", + Failed = "Failed", + PendingExecution = "PendingExecution", + PendingScheduling = "PendingScheduling", + Scheduled = "Scheduled", + Succeeded = "Succeeded", + Unknown = "Unknown" +} + +// @public +export enum KnownOptimizationPreference { + Availability = "Availability", + Cost = "Cost", + CostAvailabilityBalanced = "CostAvailabilityBalanced" +} + +// @public +export enum KnownOrigin { + System = "system", + User = "user", + UserSystem = "user,system" +} + +// @public +export enum KnownProtocolTypes { + Http = "Http", + Https = "Https" +} + +// @public +export enum KnownProvisioningState { + Canceled = "Canceled", + Creating = "Creating", + Deleting = "Deleting", + Failed = "Failed", + Succeeded = "Succeeded" +} + +// @public +export enum KnownPublicIPAddressSkuName { + Basic = "Basic", + Standard = "Standard" +} + +// @public +export enum KnownPublicIPAddressSkuTier { + Global = "Global", + Regional = "Regional" +} + +// @public +export enum KnownPublicIPAllocationMethod { + Dynamic = "Dynamic", + Static = "Static" +} + +// @public +export enum KnownResourceOperationType { + Create = "Create", + Deallocate = "Deallocate", + Delete = "Delete", + Hibernate = "Hibernate", + Start = "Start", + Unknown = "Unknown" +} + +// @public +export enum KnownSecurityEncryptionTypes { + DiskWithVMGuestState = "DiskWithVMGuestState", + NonPersistedTPM = "NonPersistedTPM", + VMGuestStateOnly = "VMGuestStateOnly" +} + +// @public +export enum KnownSecurityTypes { + ConfidentialVM = "ConfidentialVM", + TrustedLaunch = "TrustedLaunch" +} + +// @public +export enum KnownSettingNames { + AutoLogon = "AutoLogon", + FirstLogonCommands = "FirstLogonCommands" +} + +// @public +export enum KnownStorageAccountTypes { + PremiumLRS = "Premium_LRS", + PremiumV2LRS = "PremiumV2_LRS", + PremiumZRS = "Premium_ZRS", + StandardLRS = "Standard_LRS", + StandardSSDLRS = "StandardSSD_LRS", + StandardSSDZRS = "StandardSSD_ZRS", + UltraSSDLRS = "UltraSSD_LRS" +} + +// @public +export enum KnownVersions { + _20260201Preview = "2026-02-01-preview" +} + +// @public +export enum KnownVirtualMachineType { + Regular = "Regular", + Spot = "Spot" +} + +// @public +export enum KnownVMAttributeSupport { + Excluded = "Excluded", + Included = "Included", + Required = "Required" +} + +// @public +export enum KnownVMCategory { + ComputeOptimized = "ComputeOptimized", + FpgaAccelerated = "FpgaAccelerated", + GeneralPurpose = "GeneralPurpose", + GpuAccelerated = "GpuAccelerated", + HighPerformanceCompute = "HighPerformanceCompute", + MemoryOptimized = "MemoryOptimized", + StorageOptimized = "StorageOptimized" +} + +// @public +export enum KnownVMOperationStatus { + Canceled = "Canceled", + CancelFailedStatusUnknown = "CancelFailedStatusUnknown", + Cancelling = "Cancelling", + Creating = "Creating", + Deleting = "Deleting", + Failed = "Failed", + Succeeded = "Succeeded" +} + +// @public +export enum KnownWindowsPatchAssessmentMode { + AutomaticByPlatform = "AutomaticByPlatform", + ImageDefault = "ImageDefault" +} + +// @public +export enum KnownWindowsVMGuestPatchAutomaticByPlatformRebootSetting { + Always = "Always", + IfRequired = "IfRequired", + Never = "Never", + Unknown = "Unknown" +} + +// @public +export enum KnownWindowsVMGuestPatchMode { + AutomaticByOS = "AutomaticByOS", + AutomaticByPlatform = "AutomaticByPlatform", + Manual = "Manual" +} + +// @public +export enum KnownZoneDistributionStrategy { + BestEffortBalanced = "BestEffortBalanced", + BestEffortSingleZone = "BestEffortSingleZone", + Prioritized = "Prioritized", + StrictBalanced = "StrictBalanced" +} + +// @public +export interface LaunchBulkInstancesOperationProperties { + capacity: number; + capacityType?: CapacityType; + computeProfile: ComputeProfile; + priorityProfile: PriorityProfile; + readonly provisioningState?: ProvisioningState; + retryPolicy?: RetryPolicy; + vmAttributes?: VMAttributes; + vmSizesProfile?: VmSizeProfile[]; + zoneAllocationPolicy?: ZoneAllocationPolicy; +} + +// @public +export interface LinuxConfiguration { + disablePasswordAuthentication?: boolean; + enableVMAgentPlatformUpdates?: boolean; + patchSettings?: LinuxPatchSettings; + provisionVMAgent?: boolean; + ssh?: SshConfiguration; +} + +// @public +export type LinuxPatchAssessmentMode = string; + +// @public +export interface LinuxPatchSettings { + assessmentMode?: LinuxPatchAssessmentMode; + automaticByPlatformSettings?: LinuxVMGuestPatchAutomaticByPlatformSettings; + patchMode?: LinuxVMGuestPatchMode; +} + +// @public +export type LinuxVMGuestPatchAutomaticByPlatformRebootSetting = string; + +// @public +export interface LinuxVMGuestPatchAutomaticByPlatformSettings { + bypassPlatformSafetyChecksOnUserSchedule?: boolean; + rebootSetting?: LinuxVMGuestPatchAutomaticByPlatformRebootSetting; +} + +// @public +export type LinuxVMGuestPatchMode = string; + +// @public +export type LocalStorageDiskType = string; + +// @public +export interface LocationBasedLaunchBulkInstancesOperation extends ProxyResource { + identity?: ManagedServiceIdentity; + plan?: Plan; + properties?: LaunchBulkInstancesOperationProperties; + tags?: Record; + zones?: string[]; +} + +// @public +export interface ManagedDiskParameters extends SubResource { + diskEncryptionSet?: DiskEncryptionSetParameters; + securityProfile?: VMDiskSecurityProfile; + storageAccountType?: StorageAccountTypes; +} + +// @public +export interface ManagedServiceIdentity { + readonly principalId?: string; + readonly tenantId?: string; + type: ManagedServiceIdentityType; + userAssignedIdentities?: Record; +} + +// @public +export type ManagedServiceIdentityType = string; + +// @public +export type Mode = string; + +// @public +export type Modes = string; + +// @public +export type NetworkApiVersion = string; + +// @public +export type NetworkInterfaceAuxiliaryMode = string; + +// @public +export type NetworkInterfaceAuxiliarySku = string; + +// @public +export interface NetworkInterfaceReference extends SubResource { + properties?: NetworkInterfaceReferenceProperties; +} + +// @public +export interface NetworkInterfaceReferenceProperties { + deleteOption?: DeleteOptions; + primary?: boolean; +} + +// @public +export interface NetworkProfile { + networkApiVersion?: NetworkApiVersion; + networkInterfaceConfigurations?: VirtualMachineNetworkInterfaceConfiguration[]; + networkInterfaces?: NetworkInterfaceReference[]; +} + +// @public +export type OperatingSystemTypes = string; + +// @public +export interface Operation { + readonly actionType?: ActionType; + display?: OperationDisplay; + readonly isDataAction?: boolean; + readonly name?: string; + readonly origin?: Origin; +} + +// @public +export interface OperationDisplay { + readonly description?: string; + readonly operation?: string; + readonly provider?: string; + readonly resource?: string; +} + +// @public +export interface OperationsListOptionalParams extends OperationOptions { +} + +// @public +export interface OperationsOperations { + list: (options?: OperationsListOptionalParams) => PagedAsyncIterableIterator; +} + +// @public +export type OperationState = string; + +// @public +export interface OperationStatusResult { + endTime?: Date; + error?: ErrorDetail; + id?: string; + name?: string; + operations?: OperationStatusResult[]; + percentComplete?: number; + readonly resourceId?: string; + startTime?: Date; + status: string; +} + +// @public +export type OptimizationPreference = string; + +// @public +export type Origin = string; + +// @public +export interface OSDisk { + caching?: CachingTypes; + createOption: DiskCreateOptionTypes; + deleteOption?: DiskDeleteOptionTypes; + diffDiskSettings?: DiffDiskSettings; + diskSizeGB?: number; + encryptionSettings?: DiskEncryptionSettings; + image?: VirtualHardDisk; + managedDisk?: ManagedDiskParameters; + name?: string; + osType?: OperatingSystemTypes; + vhd?: VirtualHardDisk; + writeAcceleratorEnabled?: boolean; +} + +// @public +export interface OSImageNotificationProfile { + enable?: boolean; + notBeforeTimeout?: string; +} + +// @public +export interface OSProfile { + adminPassword?: string; + adminUsername?: string; + allowExtensionOperations?: boolean; + computerName?: string; + customData?: string; + linuxConfiguration?: LinuxConfiguration; + requireGuestProvisionSignal?: boolean; + secrets?: VaultSecretGroup[]; + windowsConfiguration?: WindowsConfiguration; +} + +// @public +export interface PagedAsyncIterableIterator { + [Symbol.asyncIterator](): PagedAsyncIterableIterator; + byPage: (settings?: TPageSettings) => AsyncIterableIterator>; + next(): Promise>; +} + +// @public +export interface PageSettings { + continuationToken?: string; +} + +// @public +export interface PatchSettings { + assessmentMode?: WindowsPatchAssessmentMode; + automaticByPlatformSettings?: WindowsVMGuestPatchAutomaticByPlatformSettings; + enableHotpatching?: boolean; + patchMode?: WindowsVMGuestPatchMode; +} + +// @public +export interface Plan { + name: string; + product: string; + promotionCode?: string; + publisher: string; + version?: string; +} + +// @public +export interface PriorityProfile { + allocationStrategy?: AllocationStrategy; + evictionPolicy?: EvictionPolicy; + maxPricePerVM?: number; + type?: VirtualMachineType; +} + +// @public +export type ProtocolTypes = string; + +// @public +export type ProvisioningState = string; + +// @public +export interface ProxyAgentSettings { + addProxyAgentExtension?: boolean; + enabled?: boolean; + imds?: HostEndpointSettings; + keyIncarnationId?: number; + mode?: Mode; + wireServer?: HostEndpointSettings; +} + +// @public +export interface ProxyResource extends Resource { +} + +// @public +export interface PublicIPAddressSku { + name?: PublicIPAddressSkuName; + tier?: PublicIPAddressSkuTier; +} + +// @public +export type PublicIPAddressSkuName = string; + +// @public +export type PublicIPAddressSkuTier = string; + +// @public +export type PublicIPAllocationMethod = string; + +// @public +export interface Resource { + readonly id?: string; + readonly name?: string; + readonly systemData?: SystemData; + readonly type?: string; +} + +// @public +export interface ResourceOperation { + errorCode?: string; + errorDetails?: string; + operation?: ResourceOperationDetails; + resourceId?: string; +} + +// @public +export interface ResourceOperationDetails { + completedAt?: string; + deadline?: string; + deadlineType?: DeadlineType; + operationId: string; + opType?: ResourceOperationType; + resourceId?: string; + resourceOperationError?: ResourceOperationError; + retryPolicy?: RetryPolicy; + state?: OperationState; + subscriptionId?: string; + timezone?: string; +} + +// @public +export interface ResourceOperationError { + errorCode: string; + errorDetails: string; +} + +// @public +export type ResourceOperationType = string; + +// @public +export interface ResourceProvisionPayload { + baseProfile?: Record; + resourceCount: number; + resourceOverrides?: Record[]; + resourcePrefix?: string; +} + +// @public +export interface Resources { + ids: string[]; +} + +// @public +export function restorePoller(client: ComputeBulkActionsClient, 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 RetryPolicy { + retryCount?: number; + retryWindowInMinutes?: number; +} + +// @public +export interface ScheduledEventsAdditionalPublishingTargets { + eventGridAndResourceGraph?: EventGridAndResourceGraph; +} + +// @public +export interface ScheduledEventsPolicy { + allInstancesDown?: AllInstancesDown; + scheduledEventsAdditionalPublishingTargets?: ScheduledEventsAdditionalPublishingTargets; + userInitiatedReboot?: UserInitiatedReboot; + userInitiatedRedeploy?: UserInitiatedRedeploy; +} + +// @public +export interface ScheduledEventsProfile { + osImageNotificationProfile?: OSImageNotificationProfile; + terminateNotificationProfile?: TerminateNotificationProfile; +} + +// @public +export type SecurityEncryptionTypes = string; + +// @public +export interface SecurityProfile { + encryptionAtHost?: boolean; + encryptionIdentity?: EncryptionIdentity; + proxyAgentSettings?: ProxyAgentSettings; + securityType?: SecurityTypes; + uefiSettings?: UefiSettings; +} + +// @public +export type SecurityTypes = string; + +// @public +export type SettingNames = string; + +// @public +export interface SshConfiguration { + publicKeys?: SshPublicKey[]; +} + +// @public +export interface SshPublicKey { + keyData?: string; + path?: string; +} + +// @public +export interface StartResourceOperationResponse { + description: string; + location: string; + results?: ResourceOperation[]; + type: string; +} + +// @public +export type StorageAccountTypes = string; + +// @public +export interface StorageProfile { + dataDisks?: DataDisk[]; + diskControllerType?: DiskControllerTypes; + imageReference?: ImageReference; + osDisk?: OSDisk; +} + +// @public +export interface SubResource { + id?: string; +} + +// @public +export interface SystemData { + createdAt?: Date; + createdBy?: string; + createdByType?: CreatedByType; + lastModifiedAt?: Date; + lastModifiedBy?: string; + lastModifiedByType?: CreatedByType; +} + +// @public +export interface TerminateNotificationProfile { + enable?: boolean; + notBeforeTimeout?: string; +} + +// @public +export interface UefiSettings { + secureBootEnabled?: boolean; + vTpmEnabled?: boolean; +} + +// @public +export interface UserAssignedIdentity { + readonly clientId?: string; + readonly principalId?: string; +} + +// @public +export interface UserInitiatedReboot { + automaticallyApprove?: boolean; +} + +// @public +export interface UserInitiatedRedeploy { + automaticallyApprove?: boolean; +} + +// @public +export interface VaultCertificate { + certificateStore?: string; + certificateUrl?: string; +} + +// @public +export interface VaultSecretGroup { + sourceVault?: SubResource; + vaultCertificates?: VaultCertificate[]; +} + +// @public +export interface VirtualHardDisk { + uri?: string; +} + +// @public +export interface VirtualMachine { + readonly error?: ApiError; + readonly id: string; + readonly name: string; + readonly operationStatus: VMOperationStatus; + readonly type?: string; +} + +// @public +export interface VirtualMachineExtension { + name: string; + properties: VirtualMachineExtensionProperties; +} + +// @public +export interface VirtualMachineExtensionProperties { + autoUpgradeMinorVersion?: boolean; + enableAutomaticUpgrade?: boolean; + forceUpdateTag?: string; + protectedSettings?: Record; + protectedSettingsFromKeyVault?: KeyVaultSecretReference; + provisionAfterExtensions?: string[]; + publisher?: string; + settings?: Record; + suppressFailures?: boolean; + type?: string; + typeHandlerVersion?: string; +} + +// @public +export interface VirtualMachineIpTag { + ipTagType?: string; + tag?: string; +} + +// @public +export interface VirtualMachineNetworkInterfaceConfiguration { + name: string; + properties?: VirtualMachineNetworkInterfaceConfigurationProperties; + tags?: Record; +} + +// @public +export interface VirtualMachineNetworkInterfaceConfigurationProperties { + auxiliaryMode?: NetworkInterfaceAuxiliaryMode; + auxiliarySku?: NetworkInterfaceAuxiliarySku; + deleteOption?: DeleteOptions; + disableTcpStateTracking?: boolean; + dnsSettings?: VirtualMachineNetworkInterfaceDnsSettingsConfiguration; + dscpConfiguration?: SubResource; + enableAcceleratedNetworking?: boolean; + enableFpga?: boolean; + enableIPForwarding?: boolean; + ipConfigurations: VirtualMachineNetworkInterfaceIPConfiguration[]; + networkSecurityGroup?: SubResource; + primary?: boolean; +} + +// @public +export interface VirtualMachineNetworkInterfaceDnsSettingsConfiguration { + dnsServers?: string[]; +} + +// @public +export interface VirtualMachineNetworkInterfaceIPConfiguration { + name: string; + properties?: VirtualMachineNetworkInterfaceIPConfigurationProperties; +} + +// @public +export interface VirtualMachineNetworkInterfaceIPConfigurationProperties { + applicationGatewayBackendAddressPools?: SubResource[]; + applicationSecurityGroups?: SubResource[]; + loadBalancerBackendAddressPools?: SubResource[]; + primary?: boolean; + privateIPAddressVersion?: IPVersions; + publicIPAddressConfiguration?: VirtualMachinePublicIPAddressConfiguration; + subnet?: SubResource; +} + +// @public +export interface VirtualMachineProfile { + additionalCapabilities?: AdditionalCapabilities; + applicationProfile?: ApplicationProfile; + capacityReservation?: CapacityReservationProfile; + diagnosticsProfile?: DiagnosticsProfile; + extensionsTimeBudget?: string; + licenseType?: string; + networkProfile?: NetworkProfile; + osProfile?: OSProfile; + scheduledEventsPolicy?: ScheduledEventsPolicy; + scheduledEventsProfile?: ScheduledEventsProfile; + securityProfile?: SecurityProfile; + storageProfile?: StorageProfile; + userData?: string; +} + +// @public +export interface VirtualMachinePublicIPAddressConfiguration { + name: string; + properties?: VirtualMachinePublicIPAddressConfigurationProperties; + sku?: PublicIPAddressSku; + tags?: Record; +} + +// @public +export interface VirtualMachinePublicIPAddressConfigurationProperties { + deleteOption?: DeleteOptions; + dnsSettings?: VirtualMachinePublicIPAddressDnsSettingsConfiguration; + idleTimeoutInMinutes?: number; + ipTags?: VirtualMachineIpTag[]; + publicIPAddressVersion?: IPVersions; + publicIPAllocationMethod?: PublicIPAllocationMethod; + publicIPPrefix?: SubResource; +} + +// @public +export interface VirtualMachinePublicIPAddressDnsSettingsConfiguration { + domainNameLabel: string; + domainNameLabelScope?: DomainNameLabelScopeTypes; +} + +// @public +export type VirtualMachineType = string; + +// @public +export interface VMAttributeMinMaxDouble { + max?: number; + min?: number; +} + +// @public +export interface VMAttributeMinMaxInteger { + max?: number; + min?: number; +} + +// @public +export interface VMAttributes { + acceleratorCount?: VMAttributeMinMaxInteger; + acceleratorManufacturers?: AcceleratorManufacturer[]; + acceleratorSupport?: VMAttributeSupport; + acceleratorTypes?: AcceleratorType[]; + allowedVMSizes?: string[]; + architectureTypes: ArchitectureType[]; + burstableSupport?: VMAttributeSupport; + cpuManufacturers?: CpuManufacturer[]; + dataDiskCount?: VMAttributeMinMaxInteger; + excludedVMSizes?: string[]; + hyperVGenerations?: HyperVGeneration[]; + localStorageDiskTypes?: LocalStorageDiskType[]; + localStorageInGiB?: VMAttributeMinMaxDouble; + localStorageSupport?: VMAttributeSupport; + memoryInGiB: VMAttributeMinMaxDouble; + memoryInGiBPerVCpu?: VMAttributeMinMaxDouble; + networkBandwidthInMbps?: VMAttributeMinMaxDouble; + networkInterfaceCount?: VMAttributeMinMaxInteger; + rdmaNetworkInterfaceCount?: VMAttributeMinMaxInteger; + rdmaSupport?: VMAttributeSupport; + vCpuCount: VMAttributeMinMaxInteger; + vmCategories?: VMCategory[]; +} + +// @public +export type VMAttributeSupport = string; + +// @public +export type VMCategory = string; + +// @public +export interface VMDiskSecurityProfile { + diskEncryptionSet?: DiskEncryptionSetParameters; + securityEncryptionType?: SecurityEncryptionTypes; +} + +// @public +export interface VMGalleryApplication { + configurationReference?: string; + enableAutomaticUpgrade?: boolean; + order?: number; + packageReferenceId: string; + tags?: string; + treatFailureAsDeploymentFailure?: boolean; +} + +// @public +export type VMOperationStatus = string; + +// @public +export interface VmSizeProfile { + name: string; + rank?: number; +} + +// @public +export interface WindowsConfiguration { + additionalUnattendContent?: AdditionalUnattendContent[]; + enableAutomaticUpdates?: boolean; + patchSettings?: PatchSettings; + provisionVMAgent?: boolean; + timeZone?: string; + winRM?: WinRMConfiguration; +} + +// @public +export type WindowsPatchAssessmentMode = string; + +// @public +export type WindowsVMGuestPatchAutomaticByPlatformRebootSetting = string; + +// @public +export interface WindowsVMGuestPatchAutomaticByPlatformSettings { + bypassPlatformSafetyChecksOnUserSchedule?: boolean; + rebootSetting?: WindowsVMGuestPatchAutomaticByPlatformRebootSetting; +} + +// @public +export type WindowsVMGuestPatchMode = string; + +// @public +export interface WinRMConfiguration { + listeners?: WinRMListener[]; +} + +// @public +export interface WinRMListener { + certificateUrl?: string; + protocol?: ProtocolTypes; +} + +// @public +export interface ZoneAllocationPolicy { + distributionStrategy: ZoneDistributionStrategy; + zonePreferences?: ZonePreference[]; +} + +// @public +export type ZoneDistributionStrategy = string; + +// @public +export interface ZonePreference { + rank?: number; + zone: string; +} + +// (No @packageDocumentation comment for this package) + +``` diff --git a/sdk/computebulkactions/arm-computebulkactions/src/api/bulkActions/index.ts b/sdk/computebulkactions/arm-computebulkactions/src/api/bulkActions/index.ts new file mode 100644 index 000000000000..dc6ffb9b0dc0 --- /dev/null +++ b/sdk/computebulkactions/arm-computebulkactions/src/api/bulkActions/index.ts @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { + virtualMachinesCancelOperations, + virtualMachinesGetOperationStatus, + virtualMachinesExecuteDelete, + virtualMachinesExecuteCreate, + virtualMachinesExecuteStart, + virtualMachinesExecuteHibernate, + virtualMachinesExecuteDeallocate, + listVirtualMachines, + listBySubscription, + listByResourceGroup, + cancel, + $delete, + createOrUpdate, + getOperationStatus, + get, +} from "./operations.js"; +export { + BulkActionsVirtualMachinesCancelOperationsOptionalParams, + BulkActionsVirtualMachinesGetOperationStatusOptionalParams, + BulkActionsVirtualMachinesExecuteDeleteOptionalParams, + BulkActionsVirtualMachinesExecuteCreateOptionalParams, + BulkActionsVirtualMachinesExecuteStartOptionalParams, + BulkActionsVirtualMachinesExecuteHibernateOptionalParams, + BulkActionsVirtualMachinesExecuteDeallocateOptionalParams, + BulkActionsListVirtualMachinesOptionalParams, + BulkActionsListBySubscriptionOptionalParams, + BulkActionsListByResourceGroupOptionalParams, + BulkActionsCancelOptionalParams, + BulkActionsDeleteOptionalParams, + BulkActionsCreateOrUpdateOptionalParams, + BulkActionsGetOperationStatusOptionalParams, + BulkActionsGetOptionalParams, +} from "./options.js"; diff --git a/sdk/computebulkactions/arm-computebulkactions/src/api/bulkActions/operations.ts b/sdk/computebulkactions/arm-computebulkactions/src/api/bulkActions/operations.ts new file mode 100644 index 000000000000..30983bb1570f --- /dev/null +++ b/sdk/computebulkactions/arm-computebulkactions/src/api/bulkActions/operations.ts @@ -0,0 +1,881 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { ComputeBulkActionsContext as Client } from "../index.js"; +import type { + LocationBasedLaunchBulkInstancesOperation, + OperationStatusResult, + _LaunchBulkInstancesOperationListResult, + _VirtualMachineListResult, + VirtualMachine, + ExecuteDeallocateRequest, + DeallocateResourceOperationResponse, + ExecuteHibernateRequest, + HibernateResourceOperationResponse, + ExecuteStartRequest, + StartResourceOperationResponse, + ExecuteCreateRequest, + CreateResourceOperationResponse, + ExecuteDeleteRequest, + DeleteResourceOperationResponse, + GetOperationStatusRequest, + GetOperationStatusResponse, + CancelOperationsRequest, + CancelOperationsResponse, +} from "../../models/models.js"; +import { + errorResponseDeserializer, + locationBasedLaunchBulkInstancesOperationSerializer, + locationBasedLaunchBulkInstancesOperationDeserializer, + operationStatusResultDeserializer, + _launchBulkInstancesOperationListResultDeserializer, + _virtualMachineListResultDeserializer, + executeDeallocateRequestSerializer, + deallocateResourceOperationResponseDeserializer, + executeHibernateRequestSerializer, + hibernateResourceOperationResponseDeserializer, + executeStartRequestSerializer, + startResourceOperationResponseDeserializer, + executeCreateRequestSerializer, + createResourceOperationResponseDeserializer, + executeDeleteRequestSerializer, + deleteResourceOperationResponseDeserializer, + getOperationStatusRequestSerializer, + getOperationStatusResponseDeserializer, + cancelOperationsRequestSerializer, + cancelOperationsResponseDeserializer, +} from "../../models/models.js"; +import type { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; +import { buildPagedAsyncIterator } from "../../static-helpers/pagingHelpers.js"; +import { getLongRunningPoller } from "../../static-helpers/pollingHelpers.js"; +import { expandUrlTemplate } from "../../static-helpers/urlTemplate.js"; +import type { + BulkActionsVirtualMachinesCancelOperationsOptionalParams, + BulkActionsVirtualMachinesGetOperationStatusOptionalParams, + BulkActionsVirtualMachinesExecuteDeleteOptionalParams, + BulkActionsVirtualMachinesExecuteCreateOptionalParams, + BulkActionsVirtualMachinesExecuteStartOptionalParams, + BulkActionsVirtualMachinesExecuteHibernateOptionalParams, + BulkActionsVirtualMachinesExecuteDeallocateOptionalParams, + BulkActionsListVirtualMachinesOptionalParams, + BulkActionsListBySubscriptionOptionalParams, + BulkActionsListByResourceGroupOptionalParams, + BulkActionsCancelOptionalParams, + BulkActionsDeleteOptionalParams, + BulkActionsCreateOrUpdateOptionalParams, + BulkActionsGetOperationStatusOptionalParams, + BulkActionsGetOptionalParams, +} from "./options.js"; +import type { StreamableMethod, PathUncheckedResponse } from "@azure-rest/core-client"; +import { createRestError, operationOptionsToRequestParameters } from "@azure-rest/core-client"; +import type { PollerLike, OperationState } from "@azure/core-lro"; + +export function _virtualMachinesCancelOperationsSend( + context: Client, + location: string, + requestBody: CancelOperationsRequest, + options: BulkActionsVirtualMachinesCancelOperationsOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/providers/Microsoft.ComputeBulkActions/locations/{location}/virtualMachinesCancelOperations{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + location: location, + "api%2Dversion": context.apiVersion ?? "2026-02-01-preview", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).post({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { accept: "application/json", ...options.requestOptions?.headers }, + body: cancelOperationsRequestSerializer(requestBody), + }); +} + +export async function _virtualMachinesCancelOperationsDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return cancelOperationsResponseDeserializer(result.body); +} + +/** VirtualMachinesCancelOperations: Cancel a previously submitted (start/deallocate/hibernate) request */ +export async function virtualMachinesCancelOperations( + context: Client, + location: string, + requestBody: CancelOperationsRequest, + options: BulkActionsVirtualMachinesCancelOperationsOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _virtualMachinesCancelOperationsSend( + context, + location, + requestBody, + options, + ); + return _virtualMachinesCancelOperationsDeserialize(result); +} + +export function _virtualMachinesGetOperationStatusSend( + context: Client, + location: string, + requestBody: GetOperationStatusRequest, + options: BulkActionsVirtualMachinesGetOperationStatusOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/providers/Microsoft.ComputeBulkActions/locations/{location}/virtualMachinesGetOperationStatus{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + location: location, + "api%2Dversion": context.apiVersion ?? "2026-02-01-preview", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).post({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { accept: "application/json", ...options.requestOptions?.headers }, + body: getOperationStatusRequestSerializer(requestBody), + }); +} + +export async function _virtualMachinesGetOperationStatusDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return getOperationStatusResponseDeserializer(result.body); +} + +/** VirtualMachinesGetOperationStatus: Polling endpoint to read status of operations performed on virtual machines */ +export async function virtualMachinesGetOperationStatus( + context: Client, + location: string, + requestBody: GetOperationStatusRequest, + options: BulkActionsVirtualMachinesGetOperationStatusOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _virtualMachinesGetOperationStatusSend( + context, + location, + requestBody, + options, + ); + return _virtualMachinesGetOperationStatusDeserialize(result); +} + +export function _virtualMachinesExecuteDeleteSend( + context: Client, + location: string, + requestBody: ExecuteDeleteRequest, + options: BulkActionsVirtualMachinesExecuteDeleteOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/providers/Microsoft.ComputeBulkActions/locations/{location}/virtualMachinesExecuteDelete{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + location: location, + "api%2Dversion": context.apiVersion ?? "2026-02-01-preview", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).post({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { accept: "application/json", ...options.requestOptions?.headers }, + body: executeDeleteRequestSerializer(requestBody), + }); +} + +export async function _virtualMachinesExecuteDeleteDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return deleteResourceOperationResponseDeserializer(result.body); +} + +/** VirtualMachinesExecuteDelete: Execute delete operation for a batch of virtual machines, this operation is triggered as soon as Computeschedule receives it. */ +export async function virtualMachinesExecuteDelete( + context: Client, + location: string, + requestBody: ExecuteDeleteRequest, + options: BulkActionsVirtualMachinesExecuteDeleteOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _virtualMachinesExecuteDeleteSend(context, location, requestBody, options); + return _virtualMachinesExecuteDeleteDeserialize(result); +} + +export function _virtualMachinesExecuteCreateSend( + context: Client, + location: string, + requestBody: ExecuteCreateRequest, + options: BulkActionsVirtualMachinesExecuteCreateOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/providers/Microsoft.ComputeBulkActions/locations/{location}/virtualMachinesExecuteCreate{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + location: location, + "api%2Dversion": context.apiVersion ?? "2026-02-01-preview", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).post({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { accept: "application/json", ...options.requestOptions?.headers }, + body: executeCreateRequestSerializer(requestBody), + }); +} + +export async function _virtualMachinesExecuteCreateDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return createResourceOperationResponseDeserializer(result.body); +} + +/** VirtualMachinesExecuteCreate: Execute create operation for a batch of virtual machines, this operation is triggered as soon as Computeschedule receives it. */ +export async function virtualMachinesExecuteCreate( + context: Client, + location: string, + requestBody: ExecuteCreateRequest, + options: BulkActionsVirtualMachinesExecuteCreateOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _virtualMachinesExecuteCreateSend(context, location, requestBody, options); + return _virtualMachinesExecuteCreateDeserialize(result); +} + +export function _virtualMachinesExecuteStartSend( + context: Client, + location: string, + requestBody: ExecuteStartRequest, + options: BulkActionsVirtualMachinesExecuteStartOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/providers/Microsoft.ComputeBulkActions/locations/{location}/virtualMachinesExecuteStart{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + location: location, + "api%2Dversion": context.apiVersion ?? "2026-02-01-preview", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).post({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { accept: "application/json", ...options.requestOptions?.headers }, + body: executeStartRequestSerializer(requestBody), + }); +} + +export async function _virtualMachinesExecuteStartDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return startResourceOperationResponseDeserializer(result.body); +} + +/** VirtualMachinesExecuteStart: Execute start operation for a batch of virtual machines, this operation is triggered as soon as Computeschedule receives it. */ +export async function virtualMachinesExecuteStart( + context: Client, + location: string, + requestBody: ExecuteStartRequest, + options: BulkActionsVirtualMachinesExecuteStartOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _virtualMachinesExecuteStartSend(context, location, requestBody, options); + return _virtualMachinesExecuteStartDeserialize(result); +} + +export function _virtualMachinesExecuteHibernateSend( + context: Client, + location: string, + requestBody: ExecuteHibernateRequest, + options: BulkActionsVirtualMachinesExecuteHibernateOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/providers/Microsoft.ComputeBulkActions/locations/{location}/virtualMachinesExecuteHibernate{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + location: location, + "api%2Dversion": context.apiVersion ?? "2026-02-01-preview", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).post({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { accept: "application/json", ...options.requestOptions?.headers }, + body: executeHibernateRequestSerializer(requestBody), + }); +} + +export async function _virtualMachinesExecuteHibernateDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return hibernateResourceOperationResponseDeserializer(result.body); +} + +/** VirtualMachinesExecuteHibernate: Execute hibernate operation for a batch of virtual machines, this operation is triggered as soon as Computeschedule receives it. */ +export async function virtualMachinesExecuteHibernate( + context: Client, + location: string, + requestBody: ExecuteHibernateRequest, + options: BulkActionsVirtualMachinesExecuteHibernateOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _virtualMachinesExecuteHibernateSend( + context, + location, + requestBody, + options, + ); + return _virtualMachinesExecuteHibernateDeserialize(result); +} + +export function _virtualMachinesExecuteDeallocateSend( + context: Client, + location: string, + requestBody: ExecuteDeallocateRequest, + options: BulkActionsVirtualMachinesExecuteDeallocateOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/providers/Microsoft.ComputeBulkActions/locations/{location}/virtualMachinesExecuteDeallocate{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + location: location, + "api%2Dversion": context.apiVersion ?? "2026-02-01-preview", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).post({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { accept: "application/json", ...options.requestOptions?.headers }, + body: executeDeallocateRequestSerializer(requestBody), + }); +} + +export async function _virtualMachinesExecuteDeallocateDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return deallocateResourceOperationResponseDeserializer(result.body); +} + +/** VirtualMachinesExecuteDeallocate: Execute deallocate operation for a batch of virtual machines, this operation is triggered as soon as Computeschedule receives it. */ +export async function virtualMachinesExecuteDeallocate( + context: Client, + location: string, + requestBody: ExecuteDeallocateRequest, + options: BulkActionsVirtualMachinesExecuteDeallocateOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _virtualMachinesExecuteDeallocateSend( + context, + location, + requestBody, + options, + ); + return _virtualMachinesExecuteDeallocateDeserialize(result); +} + +export function _listVirtualMachinesSend( + context: Client, + resourceGroupName: string, + location: string, + name: string, + options: BulkActionsListVirtualMachinesOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ComputeBulkActions/locations/{location}/launchBulkInstancesOperations/{name}/virtualMachines{?api%2Dversion,%24filter,%24skiptoken}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + location: location, + name: name, + "api%2Dversion": context.apiVersion ?? "2026-02-01-preview", + "%24filter": options?.filter, + "%24skiptoken": options?.skiptoken, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).get({ + ...operationOptionsToRequestParameters(options), + headers: { accept: "application/json", ...options.requestOptions?.headers }, + }); +} + +export async function _listVirtualMachinesDeserialize( + result: PathUncheckedResponse, +): Promise<_VirtualMachineListResult> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return _virtualMachineListResultDeserializer(result.body); +} + +/** List VirtualMachine resources of a LaunchBulkInstancesOperation. */ +export function listVirtualMachines( + context: Client, + resourceGroupName: string, + location: string, + name: string, + options: BulkActionsListVirtualMachinesOptionalParams = { requestOptions: {} }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _listVirtualMachinesSend(context, resourceGroupName, location, name, options), + _listVirtualMachinesDeserialize, + ["200"], + { + itemName: "value", + nextLinkName: "nextLink", + apiVersion: context.apiVersion ?? "2026-02-01-preview", + }, + ); +} + +export function _listBySubscriptionSend( + context: Client, + location: string, + options: BulkActionsListBySubscriptionOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/providers/Microsoft.ComputeBulkActions/locations/{location}/launchBulkInstancesOperations{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + location: location, + "api%2Dversion": context.apiVersion ?? "2026-02-01-preview", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).get({ + ...operationOptionsToRequestParameters(options), + headers: { accept: "application/json", ...options.requestOptions?.headers }, + }); +} + +export async function _listBySubscriptionDeserialize( + result: PathUncheckedResponse, +): Promise<_LaunchBulkInstancesOperationListResult> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return _launchBulkInstancesOperationListResultDeserializer(result.body); +} + +/** List LaunchBulkInstancesOperation resources by subscriptionId. */ +export function listBySubscription( + context: Client, + location: string, + options: BulkActionsListBySubscriptionOptionalParams = { requestOptions: {} }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _listBySubscriptionSend(context, location, options), + _listBySubscriptionDeserialize, + ["200"], + { + itemName: "value", + nextLinkName: "nextLink", + apiVersion: context.apiVersion ?? "2026-02-01-preview", + }, + ); +} + +export function _listByResourceGroupSend( + context: Client, + resourceGroupName: string, + location: string, + options: BulkActionsListByResourceGroupOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ComputeBulkActions/locations/{location}/launchBulkInstancesOperations{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + location: location, + "api%2Dversion": context.apiVersion ?? "2026-02-01-preview", + }, + { + 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<_LaunchBulkInstancesOperationListResult> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return _launchBulkInstancesOperationListResultDeserializer(result.body); +} + +/** List LaunchBulkInstancesOperation resources by resource group. */ +export function listByResourceGroup( + context: Client, + resourceGroupName: string, + location: string, + options: BulkActionsListByResourceGroupOptionalParams = { requestOptions: {} }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _listByResourceGroupSend(context, resourceGroupName, location, options), + _listByResourceGroupDeserialize, + ["200"], + { + itemName: "value", + nextLinkName: "nextLink", + apiVersion: context.apiVersion ?? "2026-02-01-preview", + }, + ); +} + +export function _cancelSend( + context: Client, + resourceGroupName: string, + location: string, + name: string, + options: BulkActionsCancelOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ComputeBulkActions/locations/{location}/launchBulkInstancesOperations/{name}/cancel{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + location: location, + name: name, + "api%2Dversion": context.apiVersion ?? "2026-02-01-preview", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).post({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _cancelDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["202", "200", "201"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return; +} + +/** Cancels LaunchBulkInstancesOperation instances that have not yet launched. */ +export function cancel( + context: Client, + resourceGroupName: string, + location: string, + name: string, + options: BulkActionsCancelOptionalParams = { requestOptions: {} }, +): PollerLike, void> { + return getLongRunningPoller(context, _cancelDeserialize, ["202", "200", "201"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => _cancelSend(context, resourceGroupName, location, name, options), + resourceLocationConfig: "location", + apiVersion: context.apiVersion ?? "2026-02-01-preview", + }) as PollerLike, void>; +} + +export function _$deleteSend( + context: Client, + resourceGroupName: string, + location: string, + name: string, + options: BulkActionsDeleteOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ComputeBulkActions/locations/{location}/launchBulkInstancesOperations/{name}{?api%2Dversion,deleteInstances}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + location: location, + name: name, + "api%2Dversion": context.apiVersion ?? "2026-02-01-preview", + deleteInstances: options?.deleteInstances, + }, + { + 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 LaunchBulkInstancesOperations. */ +/** + * @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, + location: string, + name: string, + options: BulkActionsDeleteOptionalParams = { requestOptions: {} }, +): PollerLike, void> { + return getLongRunningPoller(context, _$deleteDeserialize, ["202", "204", "200"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => _$deleteSend(context, resourceGroupName, location, name, options), + resourceLocationConfig: "location", + apiVersion: context.apiVersion ?? "2026-02-01-preview", + }) as PollerLike, void>; +} + +export function _createOrUpdateSend( + context: Client, + resourceGroupName: string, + location: string, + name: string, + resource: LocationBasedLaunchBulkInstancesOperation, + options: BulkActionsCreateOrUpdateOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ComputeBulkActions/locations/{location}/launchBulkInstancesOperations/{name}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + location: location, + name: name, + "api%2Dversion": context.apiVersion ?? "2026-02-01-preview", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).put({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { accept: "application/json", ...options.requestOptions?.headers }, + body: locationBasedLaunchBulkInstancesOperationSerializer(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 locationBasedLaunchBulkInstancesOperationDeserializer(result.body); +} + +/** Creates or updates LaunchBulkInstancesOperations. */ +export function createOrUpdate( + context: Client, + resourceGroupName: string, + location: string, + name: string, + resource: LocationBasedLaunchBulkInstancesOperation, + options: BulkActionsCreateOrUpdateOptionalParams = { requestOptions: {} }, +): PollerLike< + OperationState, + LocationBasedLaunchBulkInstancesOperation +> { + return getLongRunningPoller(context, _createOrUpdateDeserialize, ["200", "201", "202"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _createOrUpdateSend(context, resourceGroupName, location, name, resource, options), + resourceLocationConfig: "azure-async-operation", + apiVersion: context.apiVersion ?? "2026-02-01-preview", + }) as PollerLike< + OperationState, + LocationBasedLaunchBulkInstancesOperation + >; +} + +export function _getOperationStatusSend( + context: Client, + location: string, + id: string, + options: BulkActionsGetOperationStatusOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/providers/Microsoft.ComputeBulkActions/locations/{location}/operations/{id}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + location: location, + id: id, + "api%2Dversion": context.apiVersion ?? "2026-02-01-preview", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).get({ + ...operationOptionsToRequestParameters(options), + headers: { accept: "application/json", ...options.requestOptions?.headers }, + }); +} + +export async function _getOperationStatusDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return operationStatusResultDeserializer(result.body); +} + +/** Get the status of a LaunchBulkInstancesOperation. */ +export async function getOperationStatus( + context: Client, + location: string, + id: string, + options: BulkActionsGetOperationStatusOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _getOperationStatusSend(context, location, id, options); + return _getOperationStatusDeserialize(result); +} + +export function _getSend( + context: Client, + resourceGroupName: string, + location: string, + name: string, + options: BulkActionsGetOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ComputeBulkActions/locations/{location}/launchBulkInstancesOperations/{name}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + location: location, + name: name, + "api%2Dversion": context.apiVersion ?? "2026-02-01-preview", + }, + { + 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 locationBasedLaunchBulkInstancesOperationDeserializer(result.body); +} + +/** Gets an instance of LaunchBulkInstancesOperations. */ +export async function get( + context: Client, + resourceGroupName: string, + location: string, + name: string, + options: BulkActionsGetOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _getSend(context, resourceGroupName, location, name, options); + return _getDeserialize(result); +} diff --git a/sdk/computebulkactions/arm-computebulkactions/src/api/bulkActions/options.ts b/sdk/computebulkactions/arm-computebulkactions/src/api/bulkActions/options.ts new file mode 100644 index 000000000000..63cb5ec5bc82 --- /dev/null +++ b/sdk/computebulkactions/arm-computebulkactions/src/api/bulkActions/options.ts @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { OperationOptions } from "@azure-rest/core-client"; + +/** Optional parameters. */ +export interface BulkActionsVirtualMachinesCancelOperationsOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface BulkActionsVirtualMachinesGetOperationStatusOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface BulkActionsVirtualMachinesExecuteDeleteOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface BulkActionsVirtualMachinesExecuteCreateOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface BulkActionsVirtualMachinesExecuteStartOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface BulkActionsVirtualMachinesExecuteHibernateOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface BulkActionsVirtualMachinesExecuteDeallocateOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface BulkActionsListVirtualMachinesOptionalParams extends OperationOptions { + /** Filter expression to filter the virtual machines. */ + filter?: string; + /** Skip token for pagination. Uses the token from a previous response to fetch the next page of results. */ + skiptoken?: string; +} + +/** Optional parameters. */ +export interface BulkActionsListBySubscriptionOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface BulkActionsListByResourceGroupOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface BulkActionsCancelOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface BulkActionsDeleteOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** When true, deletes all virtual machines created by this BulkAction Operation. */ + deleteInstances?: boolean; +} + +/** Optional parameters. */ +export interface BulkActionsCreateOrUpdateOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface BulkActionsGetOperationStatusOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface BulkActionsGetOptionalParams extends OperationOptions {} diff --git a/sdk/computebulkactions/arm-computebulkactions/src/api/computeBulkActionsContext.ts b/sdk/computebulkactions/arm-computebulkactions/src/api/computeBulkActionsContext.ts new file mode 100644 index 000000000000..5c34fc035176 --- /dev/null +++ b/sdk/computebulkactions/arm-computebulkactions/src/api/computeBulkActionsContext.ts @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { logger } from "../logger.js"; +import { KnownVersions } from "../models/models.js"; +import type { AzureSupportedClouds } from "../static-helpers/cloudSettingHelpers.js"; +import { getArmEndpoint } from "../static-helpers/cloudSettingHelpers.js"; +import type { Client, ClientOptions } from "@azure-rest/core-client"; +import { getClient } from "@azure-rest/core-client"; +import type { TokenCredential } from "@azure/core-auth"; + +/** Microsoft.ComputeBulkActions Resource Provider management API. */ +export interface ComputeBulkActionsContext extends Client { + /** The ID of the target subscription. The value must be an UUID. */ + subscriptionId: string; + /** The API version to use for this operation. */ + /** Known values of {@link KnownVersions} that the service accepts. */ + apiVersion?: string; +} + +/** Optional parameters for the client. */ +export interface ComputeBulkActionsClientOptionalParams 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; +} + +/** Microsoft.ComputeBulkActions Resource Provider management API. */ +export function createComputeBulkActions( + credential: TokenCredential, + subscriptionId: string, + options: ComputeBulkActionsClientOptionalParams = {}, +): ComputeBulkActionsContext { + const endpointUrl = + options.endpoint ?? getArmEndpoint(options.cloudSetting) ?? "https://management.azure.com"; + const prefixFromOptions = options?.userAgentOptions?.userAgentPrefix; + const userAgentInfo = `azsdk-js-arm-computebulkactions/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); + const apiVersion = options.apiVersion; + return { ...clientContext, apiVersion, subscriptionId } as ComputeBulkActionsContext; +} diff --git a/sdk/computebulkactions/arm-computebulkactions/src/api/index.ts b/sdk/computebulkactions/arm-computebulkactions/src/api/index.ts new file mode 100644 index 000000000000..5f083f83b6ac --- /dev/null +++ b/sdk/computebulkactions/arm-computebulkactions/src/api/index.ts @@ -0,0 +1,8 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { + createComputeBulkActions, + ComputeBulkActionsContext, + ComputeBulkActionsClientOptionalParams, +} from "./computeBulkActionsContext.js"; diff --git a/sdk/computebulkactions/arm-computebulkactions/src/api/operations/index.ts b/sdk/computebulkactions/arm-computebulkactions/src/api/operations/index.ts new file mode 100644 index 000000000000..24a804d14fcf --- /dev/null +++ b/sdk/computebulkactions/arm-computebulkactions/src/api/operations/index.ts @@ -0,0 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { list } from "./operations.js"; +export { OperationsListOptionalParams } from "./options.js"; diff --git a/sdk/computebulkactions/arm-computebulkactions/src/api/operations/operations.ts b/sdk/computebulkactions/arm-computebulkactions/src/api/operations/operations.ts new file mode 100644 index 000000000000..16d55fe0d6a2 --- /dev/null +++ b/sdk/computebulkactions/arm-computebulkactions/src/api/operations/operations.ts @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { ComputeBulkActionsContext as Client } from "../index.js"; +import type { _OperationListResult, Operation } from "../../models/models.js"; +import { + _operationListResultDeserializer, + errorResponseDeserializer, +} from "../../models/models.js"; +import type { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; +import { buildPagedAsyncIterator } from "../../static-helpers/pagingHelpers.js"; +import { expandUrlTemplate } from "../../static-helpers/urlTemplate.js"; +import type { OperationsListOptionalParams } from "./options.js"; +import type { StreamableMethod, PathUncheckedResponse } from "@azure-rest/core-client"; +import { createRestError, operationOptionsToRequestParameters } from "@azure-rest/core-client"; + +export function _listSend( + context: Client, + options: OperationsListOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/providers/Microsoft.ComputeBulkActions/operations{?api%2Dversion}", + { + "api%2Dversion": context.apiVersion ?? "2026-02-01-preview", + }, + { + 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<_OperationListResult> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return _operationListResultDeserializer(result.body); +} + +/** List the operations for the provider */ +export function list( + context: Client, + options: OperationsListOptionalParams = { requestOptions: {} }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _listSend(context, options), + _listDeserialize, + ["200"], + { + itemName: "value", + nextLinkName: "nextLink", + apiVersion: context.apiVersion ?? "2026-02-01-preview", + }, + ); +} diff --git a/sdk/computebulkactions/arm-computebulkactions/src/api/operations/options.ts b/sdk/computebulkactions/arm-computebulkactions/src/api/operations/options.ts new file mode 100644 index 000000000000..b9a3fd9758a3 --- /dev/null +++ b/sdk/computebulkactions/arm-computebulkactions/src/api/operations/options.ts @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { OperationOptions } from "@azure-rest/core-client"; + +/** Optional parameters. */ +export interface OperationsListOptionalParams extends OperationOptions {} diff --git a/sdk/computebulkactions/arm-computebulkactions/src/classic/bulkActions/index.ts b/sdk/computebulkactions/arm-computebulkactions/src/classic/bulkActions/index.ts new file mode 100644 index 000000000000..ab497049c79e --- /dev/null +++ b/sdk/computebulkactions/arm-computebulkactions/src/classic/bulkActions/index.ts @@ -0,0 +1,257 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { ComputeBulkActionsContext } from "../../api/computeBulkActionsContext.js"; +import { + virtualMachinesCancelOperations, + virtualMachinesGetOperationStatus, + virtualMachinesExecuteDelete, + virtualMachinesExecuteCreate, + virtualMachinesExecuteStart, + virtualMachinesExecuteHibernate, + virtualMachinesExecuteDeallocate, + listVirtualMachines, + listBySubscription, + listByResourceGroup, + cancel, + $delete, + createOrUpdate, + getOperationStatus, + get, +} from "../../api/bulkActions/operations.js"; +import type { + BulkActionsVirtualMachinesCancelOperationsOptionalParams, + BulkActionsVirtualMachinesGetOperationStatusOptionalParams, + BulkActionsVirtualMachinesExecuteDeleteOptionalParams, + BulkActionsVirtualMachinesExecuteCreateOptionalParams, + BulkActionsVirtualMachinesExecuteStartOptionalParams, + BulkActionsVirtualMachinesExecuteHibernateOptionalParams, + BulkActionsVirtualMachinesExecuteDeallocateOptionalParams, + BulkActionsListVirtualMachinesOptionalParams, + BulkActionsListBySubscriptionOptionalParams, + BulkActionsListByResourceGroupOptionalParams, + BulkActionsCancelOptionalParams, + BulkActionsDeleteOptionalParams, + BulkActionsCreateOrUpdateOptionalParams, + BulkActionsGetOperationStatusOptionalParams, + BulkActionsGetOptionalParams, +} from "../../api/bulkActions/options.js"; +import type { + LocationBasedLaunchBulkInstancesOperation, + OperationStatusResult, + VirtualMachine, + ExecuteDeallocateRequest, + DeallocateResourceOperationResponse, + ExecuteHibernateRequest, + HibernateResourceOperationResponse, + ExecuteStartRequest, + StartResourceOperationResponse, + ExecuteCreateRequest, + CreateResourceOperationResponse, + ExecuteDeleteRequest, + DeleteResourceOperationResponse, + GetOperationStatusRequest, + GetOperationStatusResponse, + CancelOperationsRequest, + CancelOperationsResponse, +} from "../../models/models.js"; +import type { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; +import type { PollerLike, OperationState } from "@azure/core-lro"; + +/** Interface representing a BulkActions operations. */ +export interface BulkActionsOperations { + /** VirtualMachinesCancelOperations: Cancel a previously submitted (start/deallocate/hibernate) request */ + virtualMachinesCancelOperations: ( + location: string, + requestBody: CancelOperationsRequest, + options?: BulkActionsVirtualMachinesCancelOperationsOptionalParams, + ) => Promise; + /** VirtualMachinesGetOperationStatus: Polling endpoint to read status of operations performed on virtual machines */ + virtualMachinesGetOperationStatus: ( + location: string, + requestBody: GetOperationStatusRequest, + options?: BulkActionsVirtualMachinesGetOperationStatusOptionalParams, + ) => Promise; + /** VirtualMachinesExecuteDelete: Execute delete operation for a batch of virtual machines, this operation is triggered as soon as Computeschedule receives it. */ + virtualMachinesExecuteDelete: ( + location: string, + requestBody: ExecuteDeleteRequest, + options?: BulkActionsVirtualMachinesExecuteDeleteOptionalParams, + ) => Promise; + /** VirtualMachinesExecuteCreate: Execute create operation for a batch of virtual machines, this operation is triggered as soon as Computeschedule receives it. */ + virtualMachinesExecuteCreate: ( + location: string, + requestBody: ExecuteCreateRequest, + options?: BulkActionsVirtualMachinesExecuteCreateOptionalParams, + ) => Promise; + /** VirtualMachinesExecuteStart: Execute start operation for a batch of virtual machines, this operation is triggered as soon as Computeschedule receives it. */ + virtualMachinesExecuteStart: ( + location: string, + requestBody: ExecuteStartRequest, + options?: BulkActionsVirtualMachinesExecuteStartOptionalParams, + ) => Promise; + /** VirtualMachinesExecuteHibernate: Execute hibernate operation for a batch of virtual machines, this operation is triggered as soon as Computeschedule receives it. */ + virtualMachinesExecuteHibernate: ( + location: string, + requestBody: ExecuteHibernateRequest, + options?: BulkActionsVirtualMachinesExecuteHibernateOptionalParams, + ) => Promise; + /** VirtualMachinesExecuteDeallocate: Execute deallocate operation for a batch of virtual machines, this operation is triggered as soon as Computeschedule receives it. */ + virtualMachinesExecuteDeallocate: ( + location: string, + requestBody: ExecuteDeallocateRequest, + options?: BulkActionsVirtualMachinesExecuteDeallocateOptionalParams, + ) => Promise; + /** List VirtualMachine resources of a LaunchBulkInstancesOperation. */ + listVirtualMachines: ( + resourceGroupName: string, + location: string, + name: string, + options?: BulkActionsListVirtualMachinesOptionalParams, + ) => PagedAsyncIterableIterator; + /** List LaunchBulkInstancesOperation resources by subscriptionId. */ + listBySubscription: ( + location: string, + options?: BulkActionsListBySubscriptionOptionalParams, + ) => PagedAsyncIterableIterator; + /** List LaunchBulkInstancesOperation resources by resource group. */ + listByResourceGroup: ( + resourceGroupName: string, + location: string, + options?: BulkActionsListByResourceGroupOptionalParams, + ) => PagedAsyncIterableIterator; + /** Cancels LaunchBulkInstancesOperation instances that have not yet launched. */ + cancel: ( + resourceGroupName: string, + location: string, + name: string, + options?: BulkActionsCancelOptionalParams, + ) => PollerLike, void>; + /** Deletes LaunchBulkInstancesOperations. */ + /** + * @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, + location: string, + name: string, + options?: BulkActionsDeleteOptionalParams, + ) => PollerLike, void>; + /** Creates or updates LaunchBulkInstancesOperations. */ + createOrUpdate: ( + resourceGroupName: string, + location: string, + name: string, + resource: LocationBasedLaunchBulkInstancesOperation, + options?: BulkActionsCreateOrUpdateOptionalParams, + ) => PollerLike< + OperationState, + LocationBasedLaunchBulkInstancesOperation + >; + /** Get the status of a LaunchBulkInstancesOperation. */ + getOperationStatus: ( + location: string, + id: string, + options?: BulkActionsGetOperationStatusOptionalParams, + ) => Promise; + /** Gets an instance of LaunchBulkInstancesOperations. */ + get: ( + resourceGroupName: string, + location: string, + name: string, + options?: BulkActionsGetOptionalParams, + ) => Promise; +} + +function _getBulkActions(context: ComputeBulkActionsContext) { + return { + virtualMachinesCancelOperations: ( + location: string, + requestBody: CancelOperationsRequest, + options?: BulkActionsVirtualMachinesCancelOperationsOptionalParams, + ) => virtualMachinesCancelOperations(context, location, requestBody, options), + virtualMachinesGetOperationStatus: ( + location: string, + requestBody: GetOperationStatusRequest, + options?: BulkActionsVirtualMachinesGetOperationStatusOptionalParams, + ) => virtualMachinesGetOperationStatus(context, location, requestBody, options), + virtualMachinesExecuteDelete: ( + location: string, + requestBody: ExecuteDeleteRequest, + options?: BulkActionsVirtualMachinesExecuteDeleteOptionalParams, + ) => virtualMachinesExecuteDelete(context, location, requestBody, options), + virtualMachinesExecuteCreate: ( + location: string, + requestBody: ExecuteCreateRequest, + options?: BulkActionsVirtualMachinesExecuteCreateOptionalParams, + ) => virtualMachinesExecuteCreate(context, location, requestBody, options), + virtualMachinesExecuteStart: ( + location: string, + requestBody: ExecuteStartRequest, + options?: BulkActionsVirtualMachinesExecuteStartOptionalParams, + ) => virtualMachinesExecuteStart(context, location, requestBody, options), + virtualMachinesExecuteHibernate: ( + location: string, + requestBody: ExecuteHibernateRequest, + options?: BulkActionsVirtualMachinesExecuteHibernateOptionalParams, + ) => virtualMachinesExecuteHibernate(context, location, requestBody, options), + virtualMachinesExecuteDeallocate: ( + location: string, + requestBody: ExecuteDeallocateRequest, + options?: BulkActionsVirtualMachinesExecuteDeallocateOptionalParams, + ) => virtualMachinesExecuteDeallocate(context, location, requestBody, options), + listVirtualMachines: ( + resourceGroupName: string, + location: string, + name: string, + options?: BulkActionsListVirtualMachinesOptionalParams, + ) => listVirtualMachines(context, resourceGroupName, location, name, options), + listBySubscription: (location: string, options?: BulkActionsListBySubscriptionOptionalParams) => + listBySubscription(context, location, options), + listByResourceGroup: ( + resourceGroupName: string, + location: string, + options?: BulkActionsListByResourceGroupOptionalParams, + ) => listByResourceGroup(context, resourceGroupName, location, options), + cancel: ( + resourceGroupName: string, + location: string, + name: string, + options?: BulkActionsCancelOptionalParams, + ) => cancel(context, resourceGroupName, location, name, options), + delete: ( + resourceGroupName: string, + location: string, + name: string, + options?: BulkActionsDeleteOptionalParams, + ) => $delete(context, resourceGroupName, location, name, options), + createOrUpdate: ( + resourceGroupName: string, + location: string, + name: string, + resource: LocationBasedLaunchBulkInstancesOperation, + options?: BulkActionsCreateOrUpdateOptionalParams, + ) => createOrUpdate(context, resourceGroupName, location, name, resource, options), + getOperationStatus: ( + location: string, + id: string, + options?: BulkActionsGetOperationStatusOptionalParams, + ) => getOperationStatus(context, location, id, options), + get: ( + resourceGroupName: string, + location: string, + name: string, + options?: BulkActionsGetOptionalParams, + ) => get(context, resourceGroupName, location, name, options), + }; +} + +export function _getBulkActionsOperations( + context: ComputeBulkActionsContext, +): BulkActionsOperations { + return { + ..._getBulkActions(context), + }; +} diff --git a/sdk/computebulkactions/arm-computebulkactions/src/classic/index.ts b/sdk/computebulkactions/arm-computebulkactions/src/classic/index.ts new file mode 100644 index 000000000000..1558000ae71a --- /dev/null +++ b/sdk/computebulkactions/arm-computebulkactions/src/classic/index.ts @@ -0,0 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { BulkActionsOperations } from "./bulkActions/index.js"; +export { OperationsOperations } from "./operations/index.js"; diff --git a/sdk/computebulkactions/arm-computebulkactions/src/classic/operations/index.ts b/sdk/computebulkactions/arm-computebulkactions/src/classic/operations/index.ts new file mode 100644 index 000000000000..d9c88516bd28 --- /dev/null +++ b/sdk/computebulkactions/arm-computebulkactions/src/classic/operations/index.ts @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { ComputeBulkActionsContext } from "../../api/computeBulkActionsContext.js"; +import { list } from "../../api/operations/operations.js"; +import type { OperationsListOptionalParams } from "../../api/operations/options.js"; +import type { Operation } from "../../models/models.js"; +import type { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; + +/** Interface representing a Operations operations. */ +export interface OperationsOperations { + /** List the operations for the provider */ + list: (options?: OperationsListOptionalParams) => PagedAsyncIterableIterator; +} + +function _getOperations(context: ComputeBulkActionsContext) { + return { + list: (options?: OperationsListOptionalParams) => list(context, options), + }; +} + +export function _getOperationsOperations(context: ComputeBulkActionsContext): OperationsOperations { + return { + ..._getOperations(context), + }; +} diff --git a/sdk/computebulkactions/arm-computebulkactions/src/computeBulkActionsClient.ts b/sdk/computebulkactions/arm-computebulkactions/src/computeBulkActionsClient.ts new file mode 100644 index 000000000000..939c5139779c --- /dev/null +++ b/sdk/computebulkactions/arm-computebulkactions/src/computeBulkActionsClient.ts @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { + ComputeBulkActionsContext, + ComputeBulkActionsClientOptionalParams, +} from "./api/index.js"; +import { createComputeBulkActions } from "./api/index.js"; +import type { BulkActionsOperations } from "./classic/bulkActions/index.js"; +import { _getBulkActionsOperations } from "./classic/bulkActions/index.js"; +import type { OperationsOperations } from "./classic/operations/index.js"; +import { _getOperationsOperations } from "./classic/operations/index.js"; +import type { TokenCredential } from "@azure/core-auth"; +import type { Pipeline } from "@azure/core-rest-pipeline"; + +export { ComputeBulkActionsClientOptionalParams } from "./api/computeBulkActionsContext.js"; + +export class ComputeBulkActionsClient { + private _client: ComputeBulkActionsContext; + /** The pipeline used by this client to make requests */ + public readonly pipeline: Pipeline; + + /** Microsoft.ComputeBulkActions Resource Provider management API. */ + constructor( + credential: TokenCredential, + subscriptionId: string, + options: ComputeBulkActionsClientOptionalParams = {}, + ) { + const prefixFromOptions = options?.userAgentOptions?.userAgentPrefix; + const userAgentPrefix = prefixFromOptions + ? `${prefixFromOptions} azsdk-js-client` + : `azsdk-js-client`; + this._client = createComputeBulkActions(credential, subscriptionId, { + ...options, + userAgentOptions: { userAgentPrefix }, + }); + this.pipeline = this._client.pipeline; + this.bulkActions = _getBulkActionsOperations(this._client); + this.operations = _getOperationsOperations(this._client); + } + + /** The operation groups for bulkActions */ + public readonly bulkActions: BulkActionsOperations; + /** The operation groups for operations */ + public readonly operations: OperationsOperations; +} diff --git a/sdk/computebulkactions/arm-computebulkactions/src/index.ts b/sdk/computebulkactions/arm-computebulkactions/src/index.ts new file mode 100644 index 000000000000..5e0f53fae612 --- /dev/null +++ b/sdk/computebulkactions/arm-computebulkactions/src/index.ts @@ -0,0 +1,254 @@ +// 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 { ComputeBulkActionsClient } from "./computeBulkActionsClient.js"; +export { restorePoller, RestorePollerOptions } from "./restorePollerHelpers.js"; +export { + Operation, + OperationDisplay, + KnownOrigin, + Origin, + KnownActionType, + ActionType, + ErrorResponse, + ErrorDetail, + ErrorAdditionalInfo, + LocationBasedLaunchBulkInstancesOperation, + LaunchBulkInstancesOperationProperties, + KnownProvisioningState, + ProvisioningState, + KnownCapacityType, + CapacityType, + PriorityProfile, + KnownVirtualMachineType, + VirtualMachineType, + KnownEvictionPolicy, + EvictionPolicy, + KnownAllocationStrategy, + AllocationStrategy, + VmSizeProfile, + VMAttributes, + VMAttributeMinMaxInteger, + VMAttributeMinMaxDouble, + KnownArchitectureType, + ArchitectureType, + KnownVMAttributeSupport, + VMAttributeSupport, + KnownLocalStorageDiskType, + LocalStorageDiskType, + KnownAcceleratorManufacturer, + AcceleratorManufacturer, + KnownAcceleratorType, + AcceleratorType, + KnownVMCategory, + VMCategory, + KnownCpuManufacturer, + CpuManufacturer, + KnownHyperVGeneration, + HyperVGeneration, + ComputeProfile, + VirtualMachineProfile, + ScheduledEventsPolicy, + UserInitiatedRedeploy, + UserInitiatedReboot, + ScheduledEventsAdditionalPublishingTargets, + EventGridAndResourceGraph, + AllInstancesDown, + StorageProfile, + ImageReference, + OSDisk, + KnownOperatingSystemTypes, + OperatingSystemTypes, + DiskEncryptionSettings, + KeyVaultSecretReference, + SubResource, + KeyVaultKeyReference, + VirtualHardDisk, + KnownCachingTypes, + CachingTypes, + DiffDiskSettings, + KnownDiffDiskOptions, + DiffDiskOptions, + KnownDiffDiskPlacement, + DiffDiskPlacement, + KnownDiskCreateOptionTypes, + DiskCreateOptionTypes, + ManagedDiskParameters, + KnownStorageAccountTypes, + StorageAccountTypes, + DiskEncryptionSetParameters, + VMDiskSecurityProfile, + KnownSecurityEncryptionTypes, + SecurityEncryptionTypes, + KnownDiskDeleteOptionTypes, + DiskDeleteOptionTypes, + DataDisk, + ApiEntityReference, + KnownDiskDetachOptionTypes, + DiskDetachOptionTypes, + KnownDiskControllerTypes, + DiskControllerTypes, + AdditionalCapabilities, + OSProfile, + WindowsConfiguration, + AdditionalUnattendContent, + KnownSettingNames, + SettingNames, + PatchSettings, + KnownWindowsVMGuestPatchMode, + WindowsVMGuestPatchMode, + KnownWindowsPatchAssessmentMode, + WindowsPatchAssessmentMode, + WindowsVMGuestPatchAutomaticByPlatformSettings, + KnownWindowsVMGuestPatchAutomaticByPlatformRebootSetting, + WindowsVMGuestPatchAutomaticByPlatformRebootSetting, + WinRMConfiguration, + WinRMListener, + KnownProtocolTypes, + ProtocolTypes, + LinuxConfiguration, + SshConfiguration, + SshPublicKey, + LinuxPatchSettings, + KnownLinuxVMGuestPatchMode, + LinuxVMGuestPatchMode, + KnownLinuxPatchAssessmentMode, + LinuxPatchAssessmentMode, + LinuxVMGuestPatchAutomaticByPlatformSettings, + KnownLinuxVMGuestPatchAutomaticByPlatformRebootSetting, + LinuxVMGuestPatchAutomaticByPlatformRebootSetting, + VaultSecretGroup, + VaultCertificate, + NetworkProfile, + NetworkInterfaceReference, + NetworkInterfaceReferenceProperties, + KnownDeleteOptions, + DeleteOptions, + KnownNetworkApiVersion, + NetworkApiVersion, + VirtualMachineNetworkInterfaceConfiguration, + VirtualMachineNetworkInterfaceConfigurationProperties, + VirtualMachineNetworkInterfaceDnsSettingsConfiguration, + VirtualMachineNetworkInterfaceIPConfiguration, + VirtualMachineNetworkInterfaceIPConfigurationProperties, + VirtualMachinePublicIPAddressConfiguration, + VirtualMachinePublicIPAddressConfigurationProperties, + VirtualMachinePublicIPAddressDnsSettingsConfiguration, + KnownDomainNameLabelScopeTypes, + DomainNameLabelScopeTypes, + VirtualMachineIpTag, + KnownIPVersions, + IPVersions, + KnownPublicIPAllocationMethod, + PublicIPAllocationMethod, + PublicIPAddressSku, + KnownPublicIPAddressSkuName, + PublicIPAddressSkuName, + KnownPublicIPAddressSkuTier, + PublicIPAddressSkuTier, + KnownNetworkInterfaceAuxiliaryMode, + NetworkInterfaceAuxiliaryMode, + KnownNetworkInterfaceAuxiliarySku, + NetworkInterfaceAuxiliarySku, + SecurityProfile, + UefiSettings, + KnownSecurityTypes, + SecurityTypes, + EncryptionIdentity, + ProxyAgentSettings, + KnownMode, + Mode, + HostEndpointSettings, + KnownModes, + Modes, + DiagnosticsProfile, + BootDiagnostics, + ScheduledEventsProfile, + TerminateNotificationProfile, + OSImageNotificationProfile, + CapacityReservationProfile, + ApplicationProfile, + VMGalleryApplication, + VirtualMachineExtension, + VirtualMachineExtensionProperties, + ZoneAllocationPolicy, + KnownZoneDistributionStrategy, + ZoneDistributionStrategy, + ZonePreference, + RetryPolicy, + ManagedServiceIdentity, + KnownManagedServiceIdentityType, + ManagedServiceIdentityType, + UserAssignedIdentity, + Plan, + ProxyResource, + Resource, + SystemData, + KnownCreatedByType, + CreatedByType, + OperationStatusResult, + VirtualMachine, + KnownVMOperationStatus, + VMOperationStatus, + ApiError, + ApiErrorBase, + InnerError, + ExecuteDeallocateRequest, + ExecutionParameters, + KnownOptimizationPreference, + OptimizationPreference, + Resources, + DeallocateResourceOperationResponse, + ResourceOperation, + ResourceOperationDetails, + KnownResourceOperationType, + ResourceOperationType, + KnownDeadlineType, + DeadlineType, + KnownOperationState, + OperationState, + ResourceOperationError, + ExecuteHibernateRequest, + HibernateResourceOperationResponse, + ExecuteStartRequest, + StartResourceOperationResponse, + ExecuteCreateRequest, + ResourceProvisionPayload, + CreateResourceOperationResponse, + ExecuteDeleteRequest, + DeleteResourceOperationResponse, + GetOperationStatusRequest, + GetOperationStatusResponse, + CancelOperationsRequest, + CancelOperationsResponse, + KnownVersions, +} from "./models/index.js"; +export { ComputeBulkActionsClientOptionalParams } from "./api/index.js"; +export { + BulkActionsVirtualMachinesCancelOperationsOptionalParams, + BulkActionsVirtualMachinesGetOperationStatusOptionalParams, + BulkActionsVirtualMachinesExecuteDeleteOptionalParams, + BulkActionsVirtualMachinesExecuteCreateOptionalParams, + BulkActionsVirtualMachinesExecuteStartOptionalParams, + BulkActionsVirtualMachinesExecuteHibernateOptionalParams, + BulkActionsVirtualMachinesExecuteDeallocateOptionalParams, + BulkActionsListVirtualMachinesOptionalParams, + BulkActionsListBySubscriptionOptionalParams, + BulkActionsListByResourceGroupOptionalParams, + BulkActionsCancelOptionalParams, + BulkActionsDeleteOptionalParams, + BulkActionsCreateOrUpdateOptionalParams, + BulkActionsGetOperationStatusOptionalParams, + BulkActionsGetOptionalParams, +} from "./api/bulkActions/index.js"; +export { OperationsListOptionalParams } from "./api/operations/index.js"; +export { BulkActionsOperations, OperationsOperations } from "./classic/index.js"; +export { PageSettings, ContinuablePage, PagedAsyncIterableIterator }; +export { AzureClouds, AzureSupportedClouds }; diff --git a/sdk/computebulkactions/arm-computebulkactions/src/logger.ts b/sdk/computebulkactions/arm-computebulkactions/src/logger.ts new file mode 100644 index 000000000000..b6be1488972e --- /dev/null +++ b/sdk/computebulkactions/arm-computebulkactions/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-computebulkactions"); diff --git a/sdk/computebulkactions/arm-computebulkactions/src/models/index.ts b/sdk/computebulkactions/arm-computebulkactions/src/models/index.ts new file mode 100644 index 000000000000..953a879ccb13 --- /dev/null +++ b/sdk/computebulkactions/arm-computebulkactions/src/models/index.ts @@ -0,0 +1,223 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { + Operation, + OperationDisplay, + KnownOrigin, + Origin, + KnownActionType, + ActionType, + ErrorResponse, + ErrorDetail, + ErrorAdditionalInfo, + LocationBasedLaunchBulkInstancesOperation, + LaunchBulkInstancesOperationProperties, + KnownProvisioningState, + ProvisioningState, + KnownCapacityType, + CapacityType, + PriorityProfile, + KnownVirtualMachineType, + VirtualMachineType, + KnownEvictionPolicy, + EvictionPolicy, + KnownAllocationStrategy, + AllocationStrategy, + VmSizeProfile, + VMAttributes, + VMAttributeMinMaxInteger, + VMAttributeMinMaxDouble, + KnownArchitectureType, + ArchitectureType, + KnownVMAttributeSupport, + VMAttributeSupport, + KnownLocalStorageDiskType, + LocalStorageDiskType, + KnownAcceleratorManufacturer, + AcceleratorManufacturer, + KnownAcceleratorType, + AcceleratorType, + KnownVMCategory, + VMCategory, + KnownCpuManufacturer, + CpuManufacturer, + KnownHyperVGeneration, + HyperVGeneration, + ComputeProfile, + VirtualMachineProfile, + ScheduledEventsPolicy, + UserInitiatedRedeploy, + UserInitiatedReboot, + ScheduledEventsAdditionalPublishingTargets, + EventGridAndResourceGraph, + AllInstancesDown, + StorageProfile, + ImageReference, + OSDisk, + KnownOperatingSystemTypes, + OperatingSystemTypes, + DiskEncryptionSettings, + KeyVaultSecretReference, + SubResource, + KeyVaultKeyReference, + VirtualHardDisk, + KnownCachingTypes, + CachingTypes, + DiffDiskSettings, + KnownDiffDiskOptions, + DiffDiskOptions, + KnownDiffDiskPlacement, + DiffDiskPlacement, + KnownDiskCreateOptionTypes, + DiskCreateOptionTypes, + ManagedDiskParameters, + KnownStorageAccountTypes, + StorageAccountTypes, + DiskEncryptionSetParameters, + VMDiskSecurityProfile, + KnownSecurityEncryptionTypes, + SecurityEncryptionTypes, + KnownDiskDeleteOptionTypes, + DiskDeleteOptionTypes, + DataDisk, + ApiEntityReference, + KnownDiskDetachOptionTypes, + DiskDetachOptionTypes, + KnownDiskControllerTypes, + DiskControllerTypes, + AdditionalCapabilities, + OSProfile, + WindowsConfiguration, + AdditionalUnattendContent, + KnownSettingNames, + SettingNames, + PatchSettings, + KnownWindowsVMGuestPatchMode, + WindowsVMGuestPatchMode, + KnownWindowsPatchAssessmentMode, + WindowsPatchAssessmentMode, + WindowsVMGuestPatchAutomaticByPlatformSettings, + KnownWindowsVMGuestPatchAutomaticByPlatformRebootSetting, + WindowsVMGuestPatchAutomaticByPlatformRebootSetting, + WinRMConfiguration, + WinRMListener, + KnownProtocolTypes, + ProtocolTypes, + LinuxConfiguration, + SshConfiguration, + SshPublicKey, + LinuxPatchSettings, + KnownLinuxVMGuestPatchMode, + LinuxVMGuestPatchMode, + KnownLinuxPatchAssessmentMode, + LinuxPatchAssessmentMode, + LinuxVMGuestPatchAutomaticByPlatformSettings, + KnownLinuxVMGuestPatchAutomaticByPlatformRebootSetting, + LinuxVMGuestPatchAutomaticByPlatformRebootSetting, + VaultSecretGroup, + VaultCertificate, + NetworkProfile, + NetworkInterfaceReference, + NetworkInterfaceReferenceProperties, + KnownDeleteOptions, + DeleteOptions, + KnownNetworkApiVersion, + NetworkApiVersion, + VirtualMachineNetworkInterfaceConfiguration, + VirtualMachineNetworkInterfaceConfigurationProperties, + VirtualMachineNetworkInterfaceDnsSettingsConfiguration, + VirtualMachineNetworkInterfaceIPConfiguration, + VirtualMachineNetworkInterfaceIPConfigurationProperties, + VirtualMachinePublicIPAddressConfiguration, + VirtualMachinePublicIPAddressConfigurationProperties, + VirtualMachinePublicIPAddressDnsSettingsConfiguration, + KnownDomainNameLabelScopeTypes, + DomainNameLabelScopeTypes, + VirtualMachineIpTag, + KnownIPVersions, + IPVersions, + KnownPublicIPAllocationMethod, + PublicIPAllocationMethod, + PublicIPAddressSku, + KnownPublicIPAddressSkuName, + PublicIPAddressSkuName, + KnownPublicIPAddressSkuTier, + PublicIPAddressSkuTier, + KnownNetworkInterfaceAuxiliaryMode, + NetworkInterfaceAuxiliaryMode, + KnownNetworkInterfaceAuxiliarySku, + NetworkInterfaceAuxiliarySku, + SecurityProfile, + UefiSettings, + KnownSecurityTypes, + SecurityTypes, + EncryptionIdentity, + ProxyAgentSettings, + KnownMode, + Mode, + HostEndpointSettings, + KnownModes, + Modes, + DiagnosticsProfile, + BootDiagnostics, + ScheduledEventsProfile, + TerminateNotificationProfile, + OSImageNotificationProfile, + CapacityReservationProfile, + ApplicationProfile, + VMGalleryApplication, + VirtualMachineExtension, + VirtualMachineExtensionProperties, + ZoneAllocationPolicy, + KnownZoneDistributionStrategy, + ZoneDistributionStrategy, + ZonePreference, + RetryPolicy, + ManagedServiceIdentity, + KnownManagedServiceIdentityType, + ManagedServiceIdentityType, + UserAssignedIdentity, + Plan, + ProxyResource, + Resource, + SystemData, + KnownCreatedByType, + CreatedByType, + OperationStatusResult, + VirtualMachine, + KnownVMOperationStatus, + VMOperationStatus, + ApiError, + ApiErrorBase, + InnerError, + ExecuteDeallocateRequest, + ExecutionParameters, + KnownOptimizationPreference, + OptimizationPreference, + Resources, + DeallocateResourceOperationResponse, + ResourceOperation, + ResourceOperationDetails, + KnownResourceOperationType, + ResourceOperationType, + KnownDeadlineType, + DeadlineType, + KnownOperationState, + OperationState, + ResourceOperationError, + ExecuteHibernateRequest, + HibernateResourceOperationResponse, + ExecuteStartRequest, + StartResourceOperationResponse, + ExecuteCreateRequest, + ResourceProvisionPayload, + CreateResourceOperationResponse, + ExecuteDeleteRequest, + DeleteResourceOperationResponse, + GetOperationStatusRequest, + GetOperationStatusResponse, + CancelOperationsRequest, + CancelOperationsResponse, + KnownVersions, +} from "./models.js"; diff --git a/sdk/computebulkactions/arm-computebulkactions/src/models/models.ts b/sdk/computebulkactions/arm-computebulkactions/src/models/models.ts new file mode 100644 index 000000000000..ef28006fc899 --- /dev/null +++ b/sdk/computebulkactions/arm-computebulkactions/src/models/models.ts @@ -0,0 +1,4880 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +/** + * This file contains only generated model types and their (de)serializers. + * Disable the following rules for internal models with '_' prefix and deserializers which require 'any' for raw JSON input. + */ +/* eslint-disable @typescript-eslint/naming-convention */ +/* eslint-disable @typescript-eslint/explicit-module-boundary-types */ +/** A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of results. */ +export interface _OperationListResult { + /** The Operation items on this page */ + value: Operation[]; + /** The link to the next page of items */ + nextLink?: string; +} + +export function _operationListResultDeserializer(item: any): _OperationListResult { + return { + value: operationArrayDeserializer(item["value"]), + nextLink: item["nextLink"], + }; +} + +export function operationArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return operationDeserializer(item); + }); +} + +/** Details of a REST API operation, returned from the Resource Provider Operations API */ +export interface Operation { + /** The name of the operation, as per Resource-Based Access Control (RBAC). Examples: "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action" */ + readonly name?: string; + /** Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for Azure Resource Manager/control-plane operations. */ + readonly isDataAction?: boolean; + /** Localized display information for this particular operation. */ + display?: OperationDisplay; + /** The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is "user,system" */ + readonly origin?: Origin; + /** Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. */ + readonly actionType?: ActionType; +} + +export function operationDeserializer(item: any): Operation { + return { + name: item["name"], + isDataAction: item["isDataAction"], + display: !item["display"] ? item["display"] : operationDisplayDeserializer(item["display"]), + origin: item["origin"], + actionType: item["actionType"], + }; +} + +/** Localized display information for an operation. */ +export interface OperationDisplay { + /** The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or "Microsoft Compute". */ + readonly provider?: string; + /** The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or "Job Schedule Collections". */ + readonly resource?: string; + /** The concise, localized friendly name for the operation; suitable for dropdowns. E.g. "Create or Update Virtual Machine", "Restart Virtual Machine". */ + readonly operation?: string; + /** The short, localized friendly description of the operation; suitable for tool tips and detailed views. */ + readonly description?: string; +} + +export function operationDisplayDeserializer(item: any): OperationDisplay { + return { + provider: item["provider"], + resource: item["resource"], + operation: item["operation"], + description: item["description"], + }; +} + +/** The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is "user,system" */ +export enum KnownOrigin { + /** Indicates the operation is initiated by a user. */ + User = "user", + /** Indicates the operation is initiated by a system. */ + System = "system", + /** Indicates the operation is initiated by a user or system. */ + UserSystem = "user,system", +} + +/** + * The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is "user,system" \ + * {@link KnownOrigin} can be used interchangeably with Origin, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **user**: Indicates the operation is initiated by a user. \ + * **system**: Indicates the operation is initiated by a system. \ + * **user,system**: Indicates the operation is initiated by a user or system. + */ +export type Origin = string; + +/** Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. */ +export enum KnownActionType { + /** Actions are for internal-only APIs. */ + Internal = "Internal", +} + +/** + * Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. \ + * {@link KnownActionType} can be used interchangeably with ActionType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Internal**: Actions are for internal-only APIs. + */ +export type ActionType = 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"], + }; +} + +/** Location based type. */ +export interface LocationBasedLaunchBulkInstancesOperation extends ProxyResource { + /** The resource-specific properties for this resource. */ + properties?: LaunchBulkInstancesOperationProperties; + /** Zones in which the LaunchBulkInstancesOperation is available */ + zones?: string[]; + /** Resource tags. */ + tags?: Record; + /** The managed service identities assigned to this resource. */ + identity?: ManagedServiceIdentity; + /** Details of the resource plan. */ + plan?: Plan; +} + +export function locationBasedLaunchBulkInstancesOperationSerializer( + item: LocationBasedLaunchBulkInstancesOperation, +): any { + return { + properties: !item["properties"] + ? item["properties"] + : launchBulkInstancesOperationPropertiesSerializer(item["properties"]), + zones: !item["zones"] + ? item["zones"] + : item["zones"].map((p: any) => { + return p; + }), + tags: item["tags"], + identity: !item["identity"] + ? item["identity"] + : managedServiceIdentitySerializer(item["identity"]), + plan: !item["plan"] ? item["plan"] : planSerializer(item["plan"]), + }; +} + +export function locationBasedLaunchBulkInstancesOperationDeserializer( + item: any, +): LocationBasedLaunchBulkInstancesOperation { + return { + id: item["id"], + name: item["name"], + type: item["type"], + systemData: !item["systemData"] + ? item["systemData"] + : systemDataDeserializer(item["systemData"]), + properties: !item["properties"] + ? item["properties"] + : launchBulkInstancesOperationPropertiesDeserializer(item["properties"]), + zones: !item["zones"] + ? item["zones"] + : item["zones"].map((p: any) => { + return p; + }), + tags: !item["tags"] + ? item["tags"] + : Object.fromEntries(Object.entries(item["tags"]).map(([k, p]: [string, any]) => [k, p])), + identity: !item["identity"] + ? item["identity"] + : managedServiceIdentityDeserializer(item["identity"]), + plan: !item["plan"] ? item["plan"] : planDeserializer(item["plan"]), + }; +} + +/** Details of the LaunchBulkInstancesOperation. */ +export interface LaunchBulkInstancesOperationProperties { + /** The status of the last operation. */ + readonly provisioningState?: ProvisioningState; + /** Total capacity to achieve. It can be in terms of VMs or vCPUs. */ + capacity: number; + /** Specifies capacity type for launching instances. It can be in terms of VMs or vCPUs. */ + capacityType?: CapacityType; + /** Configuration Options for Regular or Spot instances in LaunchBulkInstancesOperation. */ + priorityProfile: PriorityProfile; + /** List of VM sizes supported for LaunchBulkInstancesOperation */ + vmSizesProfile?: VmSizeProfile[]; + /** Attributes to launch instances. */ + vmAttributes?: VMAttributes; + /** Compute Profile to configure the Virtual Machines. */ + computeProfile: ComputeProfile; + /** Zone Allocation Policy for launching instances. */ + zoneAllocationPolicy?: ZoneAllocationPolicy; + /** Retry policy the user can pass */ + retryPolicy?: RetryPolicy; +} + +export function launchBulkInstancesOperationPropertiesSerializer( + item: LaunchBulkInstancesOperationProperties, +): any { + return { + capacity: item["capacity"], + capacityType: item["capacityType"], + priorityProfile: priorityProfileSerializer(item["priorityProfile"]), + vmSizesProfile: !item["vmSizesProfile"] + ? item["vmSizesProfile"] + : vmSizeProfileArraySerializer(item["vmSizesProfile"]), + vmAttributes: !item["vmAttributes"] + ? item["vmAttributes"] + : vmAttributesSerializer(item["vmAttributes"]), + computeProfile: computeProfileSerializer(item["computeProfile"]), + zoneAllocationPolicy: !item["zoneAllocationPolicy"] + ? item["zoneAllocationPolicy"] + : zoneAllocationPolicySerializer(item["zoneAllocationPolicy"]), + retryPolicy: !item["retryPolicy"] + ? item["retryPolicy"] + : retryPolicySerializer(item["retryPolicy"]), + }; +} + +export function launchBulkInstancesOperationPropertiesDeserializer( + item: any, +): LaunchBulkInstancesOperationProperties { + return { + provisioningState: item["provisioningState"], + capacity: item["capacity"], + capacityType: item["capacityType"], + priorityProfile: priorityProfileDeserializer(item["priorityProfile"]), + vmSizesProfile: !item["vmSizesProfile"] + ? item["vmSizesProfile"] + : vmSizeProfileArrayDeserializer(item["vmSizesProfile"]), + vmAttributes: !item["vmAttributes"] + ? item["vmAttributes"] + : vmAttributesDeserializer(item["vmAttributes"]), + computeProfile: computeProfileDeserializer(item["computeProfile"]), + zoneAllocationPolicy: !item["zoneAllocationPolicy"] + ? item["zoneAllocationPolicy"] + : zoneAllocationPolicyDeserializer(item["zoneAllocationPolicy"]), + retryPolicy: !item["retryPolicy"] + ? item["retryPolicy"] + : retryPolicyDeserializer(item["retryPolicy"]), + }; +} + +/** The status of the LaunchBulkInstancesOperation. */ +export enum KnownProvisioningState { + /** Initial creation in progress. */ + Creating = "Creating", + /** The operation has completed successfully. */ + Succeeded = "Succeeded", + /** The operation has failed. */ + Failed = "Failed", + /** Deletion in progress. */ + Deleting = "Deleting", + /** The operation has been canceled. */ + Canceled = "Canceled", +} + +/** + * The status of the LaunchBulkInstancesOperation. \ + * {@link KnownProvisioningState} can be used interchangeably with ProvisioningState, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Creating**: Initial creation in progress. \ + * **Succeeded**: The operation has completed successfully. \ + * **Failed**: The operation has failed. \ + * **Deleting**: Deletion in progress. \ + * **Canceled**: The operation has been canceled. + */ +export type ProvisioningState = string; + +/** Capacity types for LaunchBulkInstancesOperation. */ +export enum KnownCapacityType { + /** Default. VM is the default capacity type for LaunchBulkInstancesOperation where capacity is provisioned in terms of VMs. */ + VM = "VM", + /** VCpu is the capacity type for LaunchBulkInstancesOperation where capacity is provisioned in terms of VCpus. If VCpu capacity is not exactly divisible by VCpu count in VMSizes, capacity in VCpus will be overprovisioned by default. */ + VCpu = "VCpu", +} + +/** + * Capacity types for LaunchBulkInstancesOperation. \ + * {@link KnownCapacityType} can be used interchangeably with CapacityType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **VM**: Default. VM is the default capacity type for LaunchBulkInstancesOperation where capacity is provisioned in terms of VMs. \ + * **VCpu**: VCpu is the capacity type for LaunchBulkInstancesOperation where capacity is provisioned in terms of VCpus. If VCpu capacity is not exactly divisible by VCpu count in VMSizes, capacity in VCpus will be overprovisioned by default. + */ +export type CapacityType = string; + +/** Contains properties that are applicable to both Spot and Regular. */ +export interface PriorityProfile { + /** Specifies the type of Virtual Machine. */ + type?: VirtualMachineType; + /** Price per hour of each Spot VM will never exceed this. */ + maxPricePerVM?: number; + /** Eviction Policy to follow when evicting Spot VMs. */ + evictionPolicy?: EvictionPolicy; + /** Allocation strategy to follow when determining the VM sizes distribution. */ + allocationStrategy?: AllocationStrategy; +} + +export function priorityProfileSerializer(item: PriorityProfile): any { + return { + type: item["type"], + maxPricePerVM: item["maxPricePerVM"], + evictionPolicy: item["evictionPolicy"], + allocationStrategy: item["allocationStrategy"], + }; +} + +export function priorityProfileDeserializer(item: any): PriorityProfile { + return { + type: item["type"], + maxPricePerVM: item["maxPricePerVM"], + evictionPolicy: item["evictionPolicy"], + allocationStrategy: item["allocationStrategy"], + }; +} + +/** Specifies the priority type of virtual machines to launch. */ +export enum KnownVirtualMachineType { + /** Default. Regular/On-demand VMs will be launched */ + Regular = "Regular", + /** Spot VMs will be launched. */ + Spot = "Spot", +} + +/** + * Specifies the priority type of virtual machines to launch. \ + * {@link KnownVirtualMachineType} can be used interchangeably with VirtualMachineType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Regular**: Default. Regular\/On-demand VMs will be launched \ + * **Spot**: Spot VMs will be launched. + */ +export type VirtualMachineType = string; + +/** Different kind of eviction policies */ +export enum KnownEvictionPolicy { + /** When evicted, the Spot VM will be deleted and the corresponding capacity will be updated to reflect this. */ + Delete = "Delete", + /** When evicted, the Spot VM will be deallocated/stopped */ + Deallocate = "Deallocate", +} + +/** + * Different kind of eviction policies \ + * {@link KnownEvictionPolicy} can be used interchangeably with EvictionPolicy, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Delete**: When evicted, the Spot VM will be deleted and the corresponding capacity will be updated to reflect this. \ + * **Deallocate**: When evicted, the Spot VM will be deallocated\/stopped + */ +export type EvictionPolicy = string; + +/** Allocation strategy types for LaunchBulkInstancesOperation */ +export enum KnownAllocationStrategy { + /** Default. VM sizes distribution will be determined to optimize for price. Note: Capacity will still be considered here but will be given much less weight. */ + LowestPrice = "LowestPrice", + /** VM sizes distribution will be determined to optimize for capacity. */ + CapacityOptimized = "CapacityOptimized", + /** VM sizes distribution will be determined to optimize for the 'rank' specified for each vm size. */ + Prioritized = "Prioritized", +} + +/** + * Allocation strategy types for LaunchBulkInstancesOperation \ + * {@link KnownAllocationStrategy} can be used interchangeably with AllocationStrategy, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **LowestPrice**: Default. VM sizes distribution will be determined to optimize for price. Note: Capacity will still be considered here but will be given much less weight. \ + * **CapacityOptimized**: VM sizes distribution will be determined to optimize for capacity. \ + * **Prioritized**: VM sizes distribution will be determined to optimize for the 'rank' specified for each vm size. + */ +export type AllocationStrategy = string; + +export function vmSizeProfileArraySerializer(result: Array): any[] { + return result.map((item) => { + return vmSizeProfileSerializer(item); + }); +} + +export function vmSizeProfileArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return vmSizeProfileDeserializer(item); + }); +} + +/** Specifications about a VM Size. This will also contain the corresponding rank and weight in future. */ +export interface VmSizeProfile { + /** The Sku name (e.g. 'Standard_DS1_v2') */ + name: string; + /** + * The rank of the VM size. This is used with 'AllocationStrategy.Prioritized' + * The lower the number, the higher the priority. Starting with 0. + */ + rank?: number; +} + +export function vmSizeProfileSerializer(item: VmSizeProfile): any { + return { name: item["name"], rank: item["rank"] }; +} + +export function vmSizeProfileDeserializer(item: any): VmSizeProfile { + return { + name: item["name"], + rank: item["rank"], + }; +} + +/** VMAttributes that will be used to filter VMSizes which will be used to launch instances. */ +export interface VMAttributes { + /** The range of vCpuCount specified from Min to Max. Must be specified if VMAttributes are specified, either Min or Max is required if specified. */ + vCpuCount: VMAttributeMinMaxInteger; + /** The range of memory specified from Min to Max. Must be specified if VMAttributes are specified, either Min or Max is required if specified. */ + memoryInGiB: VMAttributeMinMaxDouble; + /** The VM architecture types specified as a list. Must be specified if VMAttributes are specified. Must be compatible with image used. */ + architectureTypes: ArchitectureType[]; + /** The range of memory in GiB per vCPU specified from min to max. Optional parameter. Either Min or Max is required if specified. */ + memoryInGiBPerVCpu?: VMAttributeMinMaxDouble; + /** + * Specifies whether the VMSize supporting local storage should be used to launch instances or not. + * Included - Default if not specified as most Azure VMs support local storage. + */ + localStorageSupport?: VMAttributeSupport; + /** + * LocalStorageSupport should be set to "Included" or "Required" to use this VMAttribute. + * If localStorageSupport is "Excluded", this VMAttribute can not be used. + */ + localStorageInGiB?: VMAttributeMinMaxDouble; + /** + * The local storage disk types specified as a list. LocalStorageSupport should be set to "Included" or "Required" to use this VMAttribute. + * If localStorageSupport is "Excluded", this VMAttribute can not be used. + */ + localStorageDiskTypes?: LocalStorageDiskType[]; + /** The range of data disk count specified from Min to Max. Optional parameter. Either Min or Max is required if specified. */ + dataDiskCount?: VMAttributeMinMaxInteger; + /** The range of network interface count specified from Min to Max. Optional parameter. Either Min or Max is required if specified. */ + networkInterfaceCount?: VMAttributeMinMaxInteger; + /** The range of network bandwidth in Mbps specified from Min to Max. Optional parameter. Either Min or Max is required if specified. */ + networkBandwidthInMbps?: VMAttributeMinMaxDouble; + /** Specifies whether the VMSize supporting RDMA (Remote Direct Memory Access) should be used to build launch instances or not. */ + rdmaSupport?: VMAttributeSupport; + /** + * The range of RDMA (Remote Direct Memory Access) network interface count specified from Min to Max. Optional parameter. Either Min or Max is required if specified. + * rdmaSupport should be set to "Included" or "Required" to use this VMAttribute. + * If rdmaSupport is "Excluded", this VMAttribute can not be used. + */ + rdmaNetworkInterfaceCount?: VMAttributeMinMaxInteger; + /** + * Specifies whether the VMSize supporting accelerator should be used to launch instances or not. + * acceleratorSupport should be set to "Included" or "Required" to use this VMAttribute. + * If acceleratorSupport is "Excluded", this VMAttribute can not be used. + */ + acceleratorSupport?: VMAttributeSupport; + /** + * The accelerator manufacturers specified as a list. + * acceleratorSupport should be set to "Included" or "Required" to use this VMAttribute. + * If acceleratorSupport is "Excluded", this VMAttribute can not be used. + */ + acceleratorManufacturers?: AcceleratorManufacturer[]; + /** + * The accelerator types specified as a list. acceleratorSupport should be set to "Included" or "Required" to use this VMAttribute. + * If acceleratorSupport is "Excluded", this VMAttribute can not be used. + */ + acceleratorTypes?: AcceleratorType[]; + /** + * The range of accelerator count specified from min to max. Optional parameter. Either Min or Max is required if specified. + * acceleratorSupport should be set to "Included" or "Required" to use this VMAttribute. + * If acceleratorSupport is "Excluded", this VMAttribute can not be used. + */ + acceleratorCount?: VMAttributeMinMaxInteger; + /** The VM category specified as a list. Optional parameter. */ + vmCategories?: VMCategory[]; + /** The VM CPU manufacturers specified as a list. Optional parameter. */ + cpuManufacturers?: CpuManufacturer[]; + /** The hyperV generations specified as a list. Optional parameter. */ + hyperVGenerations?: HyperVGeneration[]; + /** Specifies whether the VMSize supporting burstable capability should be used to launch instances or not. */ + burstableSupport?: VMAttributeSupport; + /** Specifies which VMSizes should be allowed while filtering on VMAttributes. Cannot be specified together with excludedVMSizes. Maximum of 10 VM sizes allowed. Optional parameter. */ + allowedVMSizes?: string[]; + /** Specifies which VMSizes should be excluded while filtering on VMAttributes. Cannot be specified together with allowedVMSizes. Maximum of 10 VM sizes allowed. Optional parameter. */ + excludedVMSizes?: string[]; +} + +export function vmAttributesSerializer(item: VMAttributes): any { + return { + vCpuCount: vmAttributeMinMaxIntegerSerializer(item["vCpuCount"]), + memoryInGiB: vmAttributeMinMaxDoubleSerializer(item["memoryInGiB"]), + architectureTypes: item["architectureTypes"].map((p: any) => { + return p; + }), + memoryInGiBPerVCpu: !item["memoryInGiBPerVCpu"] + ? item["memoryInGiBPerVCpu"] + : vmAttributeMinMaxDoubleSerializer(item["memoryInGiBPerVCpu"]), + localStorageSupport: item["localStorageSupport"], + localStorageInGiB: !item["localStorageInGiB"] + ? item["localStorageInGiB"] + : vmAttributeMinMaxDoubleSerializer(item["localStorageInGiB"]), + localStorageDiskTypes: !item["localStorageDiskTypes"] + ? item["localStorageDiskTypes"] + : item["localStorageDiskTypes"].map((p: any) => { + return p; + }), + dataDiskCount: !item["dataDiskCount"] + ? item["dataDiskCount"] + : vmAttributeMinMaxIntegerSerializer(item["dataDiskCount"]), + networkInterfaceCount: !item["networkInterfaceCount"] + ? item["networkInterfaceCount"] + : vmAttributeMinMaxIntegerSerializer(item["networkInterfaceCount"]), + networkBandwidthInMbps: !item["networkBandwidthInMbps"] + ? item["networkBandwidthInMbps"] + : vmAttributeMinMaxDoubleSerializer(item["networkBandwidthInMbps"]), + rdmaSupport: item["rdmaSupport"], + rdmaNetworkInterfaceCount: !item["rdmaNetworkInterfaceCount"] + ? item["rdmaNetworkInterfaceCount"] + : vmAttributeMinMaxIntegerSerializer(item["rdmaNetworkInterfaceCount"]), + acceleratorSupport: item["acceleratorSupport"], + acceleratorManufacturers: !item["acceleratorManufacturers"] + ? item["acceleratorManufacturers"] + : item["acceleratorManufacturers"].map((p: any) => { + return p; + }), + acceleratorTypes: !item["acceleratorTypes"] + ? item["acceleratorTypes"] + : item["acceleratorTypes"].map((p: any) => { + return p; + }), + acceleratorCount: !item["acceleratorCount"] + ? item["acceleratorCount"] + : vmAttributeMinMaxIntegerSerializer(item["acceleratorCount"]), + vmCategories: !item["vmCategories"] + ? item["vmCategories"] + : item["vmCategories"].map((p: any) => { + return p; + }), + cpuManufacturers: !item["cpuManufacturers"] + ? item["cpuManufacturers"] + : item["cpuManufacturers"].map((p: any) => { + return p; + }), + hyperVGenerations: !item["hyperVGenerations"] + ? item["hyperVGenerations"] + : item["hyperVGenerations"].map((p: any) => { + return p; + }), + burstableSupport: item["burstableSupport"], + allowedVMSizes: !item["allowedVMSizes"] + ? item["allowedVMSizes"] + : item["allowedVMSizes"].map((p: any) => { + return p; + }), + excludedVMSizes: !item["excludedVMSizes"] + ? item["excludedVMSizes"] + : item["excludedVMSizes"].map((p: any) => { + return p; + }), + }; +} + +export function vmAttributesDeserializer(item: any): VMAttributes { + return { + vCpuCount: vmAttributeMinMaxIntegerDeserializer(item["vCpuCount"]), + memoryInGiB: vmAttributeMinMaxDoubleDeserializer(item["memoryInGiB"]), + architectureTypes: item["architectureTypes"].map((p: any) => { + return p; + }), + memoryInGiBPerVCpu: !item["memoryInGiBPerVCpu"] + ? item["memoryInGiBPerVCpu"] + : vmAttributeMinMaxDoubleDeserializer(item["memoryInGiBPerVCpu"]), + localStorageSupport: item["localStorageSupport"], + localStorageInGiB: !item["localStorageInGiB"] + ? item["localStorageInGiB"] + : vmAttributeMinMaxDoubleDeserializer(item["localStorageInGiB"]), + localStorageDiskTypes: !item["localStorageDiskTypes"] + ? item["localStorageDiskTypes"] + : item["localStorageDiskTypes"].map((p: any) => { + return p; + }), + dataDiskCount: !item["dataDiskCount"] + ? item["dataDiskCount"] + : vmAttributeMinMaxIntegerDeserializer(item["dataDiskCount"]), + networkInterfaceCount: !item["networkInterfaceCount"] + ? item["networkInterfaceCount"] + : vmAttributeMinMaxIntegerDeserializer(item["networkInterfaceCount"]), + networkBandwidthInMbps: !item["networkBandwidthInMbps"] + ? item["networkBandwidthInMbps"] + : vmAttributeMinMaxDoubleDeserializer(item["networkBandwidthInMbps"]), + rdmaSupport: item["rdmaSupport"], + rdmaNetworkInterfaceCount: !item["rdmaNetworkInterfaceCount"] + ? item["rdmaNetworkInterfaceCount"] + : vmAttributeMinMaxIntegerDeserializer(item["rdmaNetworkInterfaceCount"]), + acceleratorSupport: item["acceleratorSupport"], + acceleratorManufacturers: !item["acceleratorManufacturers"] + ? item["acceleratorManufacturers"] + : item["acceleratorManufacturers"].map((p: any) => { + return p; + }), + acceleratorTypes: !item["acceleratorTypes"] + ? item["acceleratorTypes"] + : item["acceleratorTypes"].map((p: any) => { + return p; + }), + acceleratorCount: !item["acceleratorCount"] + ? item["acceleratorCount"] + : vmAttributeMinMaxIntegerDeserializer(item["acceleratorCount"]), + vmCategories: !item["vmCategories"] + ? item["vmCategories"] + : item["vmCategories"].map((p: any) => { + return p; + }), + cpuManufacturers: !item["cpuManufacturers"] + ? item["cpuManufacturers"] + : item["cpuManufacturers"].map((p: any) => { + return p; + }), + hyperVGenerations: !item["hyperVGenerations"] + ? item["hyperVGenerations"] + : item["hyperVGenerations"].map((p: any) => { + return p; + }), + burstableSupport: item["burstableSupport"], + allowedVMSizes: !item["allowedVMSizes"] + ? item["allowedVMSizes"] + : item["allowedVMSizes"].map((p: any) => { + return p; + }), + excludedVMSizes: !item["excludedVMSizes"] + ? item["excludedVMSizes"] + : item["excludedVMSizes"].map((p: any) => { + return p; + }), + }; +} + +/** While retrieving VMSizes from CRS, Min = 0 (uint.MinValue) if not specified, Max = 4294967295 (uint.MaxValue) if not specified. This allows to filter VMAttributes on all available VMSizes. */ +export interface VMAttributeMinMaxInteger { + /** Min VMSize from CRS, Min = 0 (uint.MinValue) if not specified. */ + min?: number; + /** Max VMSize from CRS, Max = 4294967295 (uint.MaxValue) if not specified. */ + max?: number; +} + +export function vmAttributeMinMaxIntegerSerializer(item: VMAttributeMinMaxInteger): any { + return { min: item["min"], max: item["max"] }; +} + +export function vmAttributeMinMaxIntegerDeserializer(item: any): VMAttributeMinMaxInteger { + return { + min: item["min"], + max: item["max"], + }; +} + +/** VMAttributes using double values. */ +export interface VMAttributeMinMaxDouble { + /** Minimum value. If not specified, no minimum filter is applied. */ + min?: number; + /** Maximum value. Must be greater than zero. Double.MaxValue(1.7976931348623157E+308). */ + max?: number; +} + +export function vmAttributeMinMaxDoubleSerializer(item: VMAttributeMinMaxDouble): any { + return { min: item["min"], max: item["max"] }; +} + +export function vmAttributeMinMaxDoubleDeserializer(item: any): VMAttributeMinMaxDouble { + return { + min: item["min"], + max: item["max"], + }; +} + +/** Architecture types supported by Azure VMs. */ +export enum KnownArchitectureType { + /** ARM64 Architecture */ + ARM64 = "ARM64", + /** X64 Architecture */ + X64 = "X64", +} + +/** + * Architecture types supported by Azure VMs. \ + * {@link KnownArchitectureType} can be used interchangeably with ArchitectureType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **ARM64**: ARM64 Architecture \ + * **X64**: X64 Architecture + */ +export type ArchitectureType = string; + +/** VMSizes supported by Azure VMs. Included is a union of Excluded and Required. */ +export enum KnownVMAttributeSupport { + /** All VMSizes having the feature support will be excluded. */ + Excluded = "Excluded", + /** VMSizes that have the feature support and that do not have the feature support will be used. Included is a union of Excluded and Required. */ + Included = "Included", + /** Only the VMSizes having the feature support will be used. */ + Required = "Required", +} + +/** + * VMSizes supported by Azure VMs. Included is a union of Excluded and Required. \ + * {@link KnownVMAttributeSupport} can be used interchangeably with VMAttributeSupport, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Excluded**: All VMSizes having the feature support will be excluded. \ + * **Included**: VMSizes that have the feature support and that do not have the feature support will be used. Included is a union of Excluded and Required. \ + * **Required**: Only the VMSizes having the feature support will be used. + */ +export type VMAttributeSupport = string; + +/** Local storage disk types supported by Azure VMs. */ +export enum KnownLocalStorageDiskType { + /** HDD DiskType. */ + HDD = "HDD", + /** SSD DiskType. */ + SSD = "SSD", +} + +/** + * Local storage disk types supported by Azure VMs. \ + * {@link KnownLocalStorageDiskType} can be used interchangeably with LocalStorageDiskType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **HDD**: HDD DiskType. \ + * **SSD**: SSD DiskType. + */ +export type LocalStorageDiskType = string; + +/** Accelerator manufacturers supported by Azure VMs. */ +export enum KnownAcceleratorManufacturer { + /** AMD GpuType */ + AMD = "AMD", + /** Nvidia GpuType */ + Nvidia = "Nvidia", + /** Xilinx GpuType */ + Xilinx = "Xilinx", +} + +/** + * Accelerator manufacturers supported by Azure VMs. \ + * {@link KnownAcceleratorManufacturer} can be used interchangeably with AcceleratorManufacturer, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **AMD**: AMD GpuType \ + * **Nvidia**: Nvidia GpuType \ + * **Xilinx**: Xilinx GpuType + */ +export type AcceleratorManufacturer = string; + +/** Accelerator types supported by Azure VMs. */ +export enum KnownAcceleratorType { + /** GPU Accelerator */ + GPU = "GPU", + /** FPGA Accelerator */ + Fpga = "FPGA", +} + +/** + * Accelerator types supported by Azure VMs. \ + * {@link KnownAcceleratorType} can be used interchangeably with AcceleratorType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **GPU**: GPU Accelerator \ + * **FPGA**: FPGA Accelerator + */ +export type AcceleratorType = string; + +/** + * VMCategories defined for Azure VMs. + * See: https://learn.microsoft.com/en-us/azure/virtual-machines/sizes/overview?tabs=breakdownseries%2Cgeneralsizelist%2Ccomputesizelist%2Cmemorysizelist%2Cstoragesizelist%2Cgpusizelist%2Cfpgasizelist%2Chpcsizelist#general-purpose + */ +export enum KnownVMCategory { + /** General purpose VM sizes provide balanced CPU-to-memory ratio. Ideal for testing and development, small to medium databases, and low to medium traffic web servers. */ + GeneralPurpose = "GeneralPurpose", + /** Compute optimized VM sizes have a high CPU-to-memory ratio. These sizes are good for medium traffic web servers, network appliances, batch processes, and application servers. */ + ComputeOptimized = "ComputeOptimized", + /** Memory optimized VM sizes offer a high memory-to-CPU ratio that is great for relational database servers, medium to large caches, and in-memory analytics. */ + MemoryOptimized = "MemoryOptimized", + /** + * Storage optimized virtual machine (VM) sizes offer high disk throughput and IO, and are ideal for Big Data, SQL, NoSQL databases, data warehousing, and large transactional databases. + * Examples include Cassandra, MongoDB, Cloudera, and Redis. + */ + StorageOptimized = "StorageOptimized", + /** + * GPU optimized VM sizes are specialized virtual machines available with single, multiple, or fractional GPUs. + * These sizes are designed for compute-intensive, graphics-intensive, and visualization workloads. + */ + GpuAccelerated = "GpuAccelerated", + /** + * FPGA optimized VM sizes are specialized virtual machines available with single or multiple FPGA. + * These sizes are designed for compute-intensive workloads. This article provides information about the number and type of FPGA, vCPUs, data disks, and NICs. + * Storage throughput and network bandwidth are also included for each size in this grouping. + */ + FpgaAccelerated = "FpgaAccelerated", + /** + * Azure High Performance Compute VMs are optimized for various HPC workloads such as computational fluid dynamics, finite element analysis, frontend and backend EDA, + * rendering, molecular dynamics, computational geo science, weather simulation, and financial risk analysis. + */ + HighPerformanceCompute = "HighPerformanceCompute", +} + +/** + * VMCategories defined for Azure VMs. + * See: https://learn.microsoft.com/en-us/azure/virtual-machines/sizes/overview?tabs=breakdownseries%2Cgeneralsizelist%2Ccomputesizelist%2Cmemorysizelist%2Cstoragesizelist%2Cgpusizelist%2Cfpgasizelist%2Chpcsizelist#general-purpose \ + * {@link KnownVMCategory} can be used interchangeably with VMCategory, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **GeneralPurpose**: General purpose VM sizes provide balanced CPU-to-memory ratio. Ideal for testing and development, small to medium databases, and low to medium traffic web servers. \ + * **ComputeOptimized**: Compute optimized VM sizes have a high CPU-to-memory ratio. These sizes are good for medium traffic web servers, network appliances, batch processes, and application servers. \ + * **MemoryOptimized**: Memory optimized VM sizes offer a high memory-to-CPU ratio that is great for relational database servers, medium to large caches, and in-memory analytics. \ + * **StorageOptimized**: Storage optimized virtual machine (VM) sizes offer high disk throughput and IO, and are ideal for Big Data, SQL, NoSQL databases, data warehousing, and large transactional databases. + * Examples include Cassandra, MongoDB, Cloudera, and Redis. \ + * **GpuAccelerated**: GPU optimized VM sizes are specialized virtual machines available with single, multiple, or fractional GPUs. + * These sizes are designed for compute-intensive, graphics-intensive, and visualization workloads. \ + * **FpgaAccelerated**: FPGA optimized VM sizes are specialized virtual machines available with single or multiple FPGA. + * These sizes are designed for compute-intensive workloads. This article provides information about the number and type of FPGA, vCPUs, data disks, and NICs. + * Storage throughput and network bandwidth are also included for each size in this grouping. \ + * **HighPerformanceCompute**: Azure High Performance Compute VMs are optimized for various HPC workloads such as computational fluid dynamics, finite element analysis, frontend and backend EDA, + * rendering, molecular dynamics, computational geo science, weather simulation, and financial risk analysis. + */ +export type VMCategory = string; + +/** Cpu Manufacturers supported by Azure VMs. */ +export enum KnownCpuManufacturer { + /** Intel CPU. */ + Intel = "Intel", + /** AMD CPU. */ + AMD = "AMD", + /** Microsoft CPU. */ + Microsoft = "Microsoft", + /** Ampere CPU. */ + Ampere = "Ampere", +} + +/** + * Cpu Manufacturers supported by Azure VMs. \ + * {@link KnownCpuManufacturer} can be used interchangeably with CpuManufacturer, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Intel**: Intel CPU. \ + * **AMD**: AMD CPU. \ + * **Microsoft**: Microsoft CPU. \ + * **Ampere**: Ampere CPU. + */ +export type CpuManufacturer = string; + +/** HyperVGenerations supported by Azure VMs. */ +export enum KnownHyperVGeneration { + /** Gen1 hyperV. */ + Gen1 = "Gen1", + /** Gen2 hyperV. */ + Gen2 = "Gen2", +} + +/** + * HyperVGenerations supported by Azure VMs. \ + * {@link KnownHyperVGeneration} can be used interchangeably with HyperVGeneration, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Gen1**: Gen1 hyperV. \ + * **Gen2**: Gen2 hyperV. + */ +export type HyperVGeneration = string; + +/** Compute Profile to configure the Virtual Machines. */ +export interface ComputeProfile { + /** Base Virtual Machine Profile Properties to be specified according to "specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/{computeApiVersion}/virtualMachine.json#/definitions/VirtualMachineProperties" */ + virtualMachineProfile: VirtualMachineProfile; + /** Virtual Machine Extensions Array to be specified according to "specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/{computeApiVersion}/virtualMachine.json#/definitions/VirtualMachineExtension" */ + extensions?: VirtualMachineExtension[]; + /** + * Specifies the Microsoft.Compute API version to use when creating underlying Virtual Machines. + * The default value will be the latest supported computeApiVersion by LaunchBulkInstancesOperation. + */ + computeApiVersion?: string; +} + +export function computeProfileSerializer(item: ComputeProfile): any { + return { + virtualMachineProfile: virtualMachineProfileSerializer(item["virtualMachineProfile"]), + extensions: !item["extensions"] + ? item["extensions"] + : virtualMachineExtensionArraySerializer(item["extensions"]), + computeApiVersion: item["computeApiVersion"], + }; +} + +export function computeProfileDeserializer(item: any): ComputeProfile { + return { + virtualMachineProfile: virtualMachineProfileDeserializer(item["virtualMachineProfile"]), + extensions: !item["extensions"] + ? item["extensions"] + : virtualMachineExtensionArrayDeserializer(item["extensions"]), + computeApiVersion: item["computeApiVersion"], + }; +} + +/** Describes the properties of a Virtual Machine. */ +export interface VirtualMachineProfile { + /** Specifies Redeploy, Reboot and ScheduledEventsAdditionalPublishingTargets Scheduled Event related configurations for the virtual machine. */ + scheduledEventsPolicy?: ScheduledEventsPolicy; + /** Specifies the storage settings for the virtual machine disks. */ + storageProfile?: StorageProfile; + /** Specifies additional capabilities enabled or disabled on the virtual machine. */ + additionalCapabilities?: AdditionalCapabilities; + /** Specifies the operating system settings used while creating the virtual machine. Some of the settings cannot be changed once VM is provisioned. */ + osProfile?: OSProfile; + /** Specifies the network interfaces of the virtual machine. */ + networkProfile?: NetworkProfile; + /** Specifies the Security related profile settings for the virtual machine. */ + securityProfile?: SecurityProfile; + /** Specifies the boot diagnostic settings state. Minimum compute api-version: 2015-06-15. */ + diagnosticsProfile?: DiagnosticsProfile; + /** Specifies that the image or disk that is being used was licensed on-premises.

Possible values for Windows Server operating system are:

Windows_Client

Windows_Server

Possible values for Linux Server operating system are:

RHEL_BYOS (for RHEL)

SLES_BYOS (for SUSE)

For more information, see [Azure Hybrid Use Benefit for Windows Server](https://docs.microsoft.com/azure/virtual-machines/windows/hybrid-use-benefit-licensing)

[Azure Hybrid Use Benefit for Linux Server](https://docs.microsoft.com/azure/virtual-machines/linux/azure-hybrid-benefit-linux)

Minimum api-version: 2015-06-15 */ + licenseType?: string; + /** Specifies the time alloted for all extensions to start. The time duration should be between 15 minutes and 120 minutes (inclusive) and should be specified in ISO 8601 format. The default value is 90 minutes (PT1H30M). Minimum compute api-version: 2020-06-01. */ + extensionsTimeBudget?: string; + /** Specifies Scheduled Event related configurations. */ + scheduledEventsProfile?: ScheduledEventsProfile; + /** UserData for the VM, which must be base-64 encoded. Customer should not pass any secrets in here. Minimum compute api-version: 2021-03-01. */ + userData?: string; + /** Specifies information about the capacity reservation that is used to allocate virtual machine. Minimum compute api-version: 2021-04-01. */ + capacityReservation?: CapacityReservationProfile; + /** Specifies the gallery applications that should be made available to the VM. */ + applicationProfile?: ApplicationProfile; +} + +export function virtualMachineProfileSerializer(item: VirtualMachineProfile): any { + return { + scheduledEventsPolicy: !item["scheduledEventsPolicy"] + ? item["scheduledEventsPolicy"] + : scheduledEventsPolicySerializer(item["scheduledEventsPolicy"]), + storageProfile: !item["storageProfile"] + ? item["storageProfile"] + : storageProfileSerializer(item["storageProfile"]), + additionalCapabilities: !item["additionalCapabilities"] + ? item["additionalCapabilities"] + : additionalCapabilitiesSerializer(item["additionalCapabilities"]), + osProfile: !item["osProfile"] ? item["osProfile"] : osProfileSerializer(item["osProfile"]), + networkProfile: !item["networkProfile"] + ? item["networkProfile"] + : networkProfileSerializer(item["networkProfile"]), + securityProfile: !item["securityProfile"] + ? item["securityProfile"] + : securityProfileSerializer(item["securityProfile"]), + diagnosticsProfile: !item["diagnosticsProfile"] + ? item["diagnosticsProfile"] + : diagnosticsProfileSerializer(item["diagnosticsProfile"]), + licenseType: item["licenseType"], + extensionsTimeBudget: item["extensionsTimeBudget"], + scheduledEventsProfile: !item["scheduledEventsProfile"] + ? item["scheduledEventsProfile"] + : scheduledEventsProfileSerializer(item["scheduledEventsProfile"]), + userData: item["userData"], + capacityReservation: !item["capacityReservation"] + ? item["capacityReservation"] + : capacityReservationProfileSerializer(item["capacityReservation"]), + applicationProfile: !item["applicationProfile"] + ? item["applicationProfile"] + : applicationProfileSerializer(item["applicationProfile"]), + }; +} + +export function virtualMachineProfileDeserializer(item: any): VirtualMachineProfile { + return { + scheduledEventsPolicy: !item["scheduledEventsPolicy"] + ? item["scheduledEventsPolicy"] + : scheduledEventsPolicyDeserializer(item["scheduledEventsPolicy"]), + storageProfile: !item["storageProfile"] + ? item["storageProfile"] + : storageProfileDeserializer(item["storageProfile"]), + additionalCapabilities: !item["additionalCapabilities"] + ? item["additionalCapabilities"] + : additionalCapabilitiesDeserializer(item["additionalCapabilities"]), + osProfile: !item["osProfile"] ? item["osProfile"] : osProfileDeserializer(item["osProfile"]), + networkProfile: !item["networkProfile"] + ? item["networkProfile"] + : networkProfileDeserializer(item["networkProfile"]), + securityProfile: !item["securityProfile"] + ? item["securityProfile"] + : securityProfileDeserializer(item["securityProfile"]), + diagnosticsProfile: !item["diagnosticsProfile"] + ? item["diagnosticsProfile"] + : diagnosticsProfileDeserializer(item["diagnosticsProfile"]), + licenseType: item["licenseType"], + extensionsTimeBudget: item["extensionsTimeBudget"], + scheduledEventsProfile: !item["scheduledEventsProfile"] + ? item["scheduledEventsProfile"] + : scheduledEventsProfileDeserializer(item["scheduledEventsProfile"]), + userData: item["userData"], + capacityReservation: !item["capacityReservation"] + ? item["capacityReservation"] + : capacityReservationProfileDeserializer(item["capacityReservation"]), + applicationProfile: !item["applicationProfile"] + ? item["applicationProfile"] + : applicationProfileDeserializer(item["applicationProfile"]), + }; +} + +/** Specifies Redeploy, Reboot and ScheduledEventsAdditionalPublishingTargets Scheduled Event related configurations. */ +export interface ScheduledEventsPolicy { + /** The configuration parameters used while creating userInitiatedRedeploy scheduled event setting creation. */ + userInitiatedRedeploy?: UserInitiatedRedeploy; + /** The configuration parameters used while creating userInitiatedReboot scheduled event setting creation. */ + userInitiatedReboot?: UserInitiatedReboot; + /** The configuration parameters used while publishing scheduledEventsAdditionalPublishingTargets. */ + scheduledEventsAdditionalPublishingTargets?: ScheduledEventsAdditionalPublishingTargets; + /** The configuration parameters used while creating AllInstancesDown scheduled event setting creation. */ + allInstancesDown?: AllInstancesDown; +} + +export function scheduledEventsPolicySerializer(item: ScheduledEventsPolicy): any { + return { + userInitiatedRedeploy: !item["userInitiatedRedeploy"] + ? item["userInitiatedRedeploy"] + : userInitiatedRedeploySerializer(item["userInitiatedRedeploy"]), + userInitiatedReboot: !item["userInitiatedReboot"] + ? item["userInitiatedReboot"] + : userInitiatedRebootSerializer(item["userInitiatedReboot"]), + scheduledEventsAdditionalPublishingTargets: !item["scheduledEventsAdditionalPublishingTargets"] + ? item["scheduledEventsAdditionalPublishingTargets"] + : scheduledEventsAdditionalPublishingTargetsSerializer( + item["scheduledEventsAdditionalPublishingTargets"], + ), + allInstancesDown: !item["allInstancesDown"] + ? item["allInstancesDown"] + : allInstancesDownSerializer(item["allInstancesDown"]), + }; +} + +export function scheduledEventsPolicyDeserializer(item: any): ScheduledEventsPolicy { + return { + userInitiatedRedeploy: !item["userInitiatedRedeploy"] + ? item["userInitiatedRedeploy"] + : userInitiatedRedeployDeserializer(item["userInitiatedRedeploy"]), + userInitiatedReboot: !item["userInitiatedReboot"] + ? item["userInitiatedReboot"] + : userInitiatedRebootDeserializer(item["userInitiatedReboot"]), + scheduledEventsAdditionalPublishingTargets: !item["scheduledEventsAdditionalPublishingTargets"] + ? item["scheduledEventsAdditionalPublishingTargets"] + : scheduledEventsAdditionalPublishingTargetsDeserializer( + item["scheduledEventsAdditionalPublishingTargets"], + ), + allInstancesDown: !item["allInstancesDown"] + ? item["allInstancesDown"] + : allInstancesDownDeserializer(item["allInstancesDown"]), + }; +} + +/** Specifies Redeploy related Scheduled Event related configurations. */ +export interface UserInitiatedRedeploy { + /** Specifies Redeploy Scheduled Event related configurations. */ + automaticallyApprove?: boolean; +} + +export function userInitiatedRedeploySerializer(item: UserInitiatedRedeploy): any { + return { automaticallyApprove: item["automaticallyApprove"] }; +} + +export function userInitiatedRedeployDeserializer(item: any): UserInitiatedRedeploy { + return { + automaticallyApprove: item["automaticallyApprove"], + }; +} + +/** Specifies Reboot related Scheduled Event related configurations. */ +export interface UserInitiatedReboot { + /** Specifies Reboot Scheduled Event related configurations. */ + automaticallyApprove?: boolean; +} + +export function userInitiatedRebootSerializer(item: UserInitiatedReboot): any { + return { automaticallyApprove: item["automaticallyApprove"] }; +} + +export function userInitiatedRebootDeserializer(item: any): UserInitiatedReboot { + return { + automaticallyApprove: item["automaticallyApprove"], + }; +} + +/** Specifies additional publishing targets for scheduled events. */ +export interface ScheduledEventsAdditionalPublishingTargets { + /** The configuration parameters used while creating eventGridAndResourceGraph Scheduled Event setting. */ + eventGridAndResourceGraph?: EventGridAndResourceGraph; +} + +export function scheduledEventsAdditionalPublishingTargetsSerializer( + item: ScheduledEventsAdditionalPublishingTargets, +): any { + return { + eventGridAndResourceGraph: !item["eventGridAndResourceGraph"] + ? item["eventGridAndResourceGraph"] + : eventGridAndResourceGraphSerializer(item["eventGridAndResourceGraph"]), + }; +} + +export function scheduledEventsAdditionalPublishingTargetsDeserializer( + item: any, +): ScheduledEventsAdditionalPublishingTargets { + return { + eventGridAndResourceGraph: !item["eventGridAndResourceGraph"] + ? item["eventGridAndResourceGraph"] + : eventGridAndResourceGraphDeserializer(item["eventGridAndResourceGraph"]), + }; +} + +/** Specifies eventGridAndResourceGraph related Scheduled Event related configurations. */ +export interface EventGridAndResourceGraph { + /** Specifies if event grid and resource graph is enabled for Scheduled event related configurations. */ + enable?: boolean; + /** Specifies the api-version to determine which Scheduled Events configuration schema version will be delivered. */ + scheduledEventsApiVersion?: string; +} + +export function eventGridAndResourceGraphSerializer(item: EventGridAndResourceGraph): any { + return { enable: item["enable"], scheduledEventsApiVersion: item["scheduledEventsApiVersion"] }; +} + +export function eventGridAndResourceGraphDeserializer(item: any): EventGridAndResourceGraph { + return { + enable: item["enable"], + scheduledEventsApiVersion: item["scheduledEventsApiVersion"], + }; +} + +/** Specifies if Scheduled Events should be auto-approved when all instances are down. */ +export interface AllInstancesDown { + /** Specifies if Scheduled Events should be auto-approved when all instances are down. Its default value is true. */ + automaticallyApprove?: boolean; +} + +export function allInstancesDownSerializer(item: AllInstancesDown): any { + return { automaticallyApprove: item["automaticallyApprove"] }; +} + +export function allInstancesDownDeserializer(item: any): AllInstancesDown { + return { + automaticallyApprove: item["automaticallyApprove"], + }; +} + +/** Specifies the storage settings for the virtual machine disks. */ +export interface StorageProfile { + /** Specifies information about the image to use. You can specify information about platform images, marketplace images, or virtual machine images. This element is required when you want to use a platform image, marketplace image, or virtual machine image, but is not used in other creation operations. */ + imageReference?: ImageReference; + /** Specifies information about the operating system disk used by the virtual machine. For more information about disks, see [About disks and VHDs for Azure virtual machines](https://docs.microsoft.com/azure/virtual-machines/managed-disks-overview). */ + osDisk?: OSDisk; + /** Specifies the parameters that are used to add a data disk to a virtual machine. For more information about disks, see [About disks and VHDs for Azure virtual machines](https://docs.microsoft.com/azure/virtual-machines/managed-disks-overview). */ + dataDisks?: DataDisk[]; + /** Specifies the disk controller type configured for the VM. **Note:** This property will be set to the default disk controller type if not specified provided virtual machine is being created with 'hyperVGeneration' set to V2 based on the capabilities of the operating system disk and VM size from the the specified minimum api version. You need to deallocate the VM before updating its disk controller type unless you are updating the VM size in the VM configuration which implicitly deallocates and reallocates the VM. Minimum api-version: 2022-08-01. */ + diskControllerType?: DiskControllerTypes; +} + +export function storageProfileSerializer(item: StorageProfile): any { + return { + imageReference: !item["imageReference"] + ? item["imageReference"] + : imageReferenceSerializer(item["imageReference"]), + osDisk: !item["osDisk"] ? item["osDisk"] : osDiskSerializer(item["osDisk"]), + dataDisks: !item["dataDisks"] ? item["dataDisks"] : dataDiskArraySerializer(item["dataDisks"]), + diskControllerType: item["diskControllerType"], + }; +} + +export function storageProfileDeserializer(item: any): StorageProfile { + return { + imageReference: !item["imageReference"] + ? item["imageReference"] + : imageReferenceDeserializer(item["imageReference"]), + osDisk: !item["osDisk"] ? item["osDisk"] : osDiskDeserializer(item["osDisk"]), + dataDisks: !item["dataDisks"] + ? item["dataDisks"] + : dataDiskArrayDeserializer(item["dataDisks"]), + diskControllerType: item["diskControllerType"], + }; +} + +/** Specifies information about the image to use. You can specify information about platform images, marketplace images, or virtual machine images. This element is required when you want to use a platform image, marketplace image, or virtual machine image, but is not used in other creation operations. NOTE: Image reference publisher and offer can only be set when you create the scale set. */ +export interface ImageReference extends SubResource { + /** The image publisher. */ + publisher?: string; + /** Specifies the offer of the platform image or marketplace image used to create the virtual machine. */ + offer?: string; + /** The image SKU. */ + sku?: string; + /** Specifies the version of the platform image or marketplace image used to create the virtual machine. The allowed formats are Major.Minor.Build or 'latest'. Major, Minor, and Build are decimal numbers. Specify 'latest' to use the latest version of an image available at deploy time. Even if you use 'latest', the VM image will not automatically update after deploy time even if a new version becomes available. Please do not use field 'version' for gallery image deployment, gallery image should always use 'id' field for deployment, to use 'latest' version of gallery image, just set '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{imageName}' in the 'id' field without version input. */ + version?: string; + /** Specified the shared gallery image unique id for vm deployment. This can be fetched from shared gallery image GET call. */ + sharedGalleryImageId?: string; + /** Specified the community gallery image unique id for vm deployment. This can be fetched from community gallery image GET call. */ + communityGalleryImageId?: string; +} + +export function imageReferenceSerializer(item: ImageReference): any { + return { + id: item["id"], + publisher: item["publisher"], + offer: item["offer"], + sku: item["sku"], + version: item["version"], + sharedGalleryImageId: item["sharedGalleryImageId"], + communityGalleryImageId: item["communityGalleryImageId"], + }; +} + +export function imageReferenceDeserializer(item: any): ImageReference { + return { + id: item["id"], + publisher: item["publisher"], + offer: item["offer"], + sku: item["sku"], + version: item["version"], + sharedGalleryImageId: item["sharedGalleryImageId"], + communityGalleryImageId: item["communityGalleryImageId"], + }; +} + +/** Specifies information about the operating system disk used by the virtual machine. For more information about disks, see [About disks and VHDs for Azure virtual machines](https://docs.microsoft.com/azure/virtual-machines/managed-disks-overview). */ +export interface OSDisk { + /** 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; + /** Specifies the encryption settings for the OS Disk. Minimum compute api-version: 2015-06-15. */ + encryptionSettings?: DiskEncryptionSettings; + /** The disk name. */ + name?: string; + /** The virtual hard disk. */ + vhd?: VirtualHardDisk; + /** The source user image virtual hard disk. The virtual hard disk will be copied before being attached to the virtual machine. If SourceImage is provided, the destination virtual hard drive must not exist. */ + image?: VirtualHardDisk; + /** Specifies the caching requirements. Possible values are: None, ReadOnly, ReadWrite. The defaulting behavior is: None for Standard storage. ReadOnly for Premium storage. */ + caching?: CachingTypes; + /** Specifies whether writeAccelerator should be enabled or disabled on the disk. */ + writeAcceleratorEnabled?: boolean; + /** Specifies the ephemeral Disk Settings for the operating system disk used by the virtual machine. */ + diffDiskSettings?: DiffDiskSettings; + /** Specifies how the virtual machine disk should be created. Possible values are Attach, FromImage. If you are using a platform image, you should also use the imageReference element described above. If you are using a marketplace image, you should also use the plan element previously described. */ + createOption: DiskCreateOptionTypes; + /** Specifies the size of an empty data disk in gigabytes. This element can be used to overwrite the size of the disk in a virtual machine image. The property 'diskSizeGB' is the number of bytes x 1024^3 for the disk and the value cannot be larger than 1023. */ + diskSizeGB?: number; + /** The managed disk parameters. */ + managedDisk?: ManagedDiskParameters; + /** Specifies whether OS Disk should be deleted or detached upon VM deletion. Possible values are: Delete, Detach. The default value is set to Detach. For an ephemeral OS Disk, the default value is set to Delete. The user cannot change the delete option for an ephemeral OS Disk. */ + deleteOption?: DiskDeleteOptionTypes; +} + +export function osDiskSerializer(item: OSDisk): any { + return { + osType: item["osType"], + encryptionSettings: !item["encryptionSettings"] + ? item["encryptionSettings"] + : diskEncryptionSettingsSerializer(item["encryptionSettings"]), + name: item["name"], + vhd: !item["vhd"] ? item["vhd"] : virtualHardDiskSerializer(item["vhd"]), + image: !item["image"] ? item["image"] : virtualHardDiskSerializer(item["image"]), + caching: item["caching"], + writeAcceleratorEnabled: item["writeAcceleratorEnabled"], + diffDiskSettings: !item["diffDiskSettings"] + ? item["diffDiskSettings"] + : diffDiskSettingsSerializer(item["diffDiskSettings"]), + createOption: item["createOption"], + diskSizeGB: item["diskSizeGB"], + managedDisk: !item["managedDisk"] + ? item["managedDisk"] + : managedDiskParametersSerializer(item["managedDisk"]), + deleteOption: item["deleteOption"], + }; +} + +export function osDiskDeserializer(item: any): OSDisk { + return { + osType: item["osType"], + encryptionSettings: !item["encryptionSettings"] + ? item["encryptionSettings"] + : diskEncryptionSettingsDeserializer(item["encryptionSettings"]), + name: item["name"], + vhd: !item["vhd"] ? item["vhd"] : virtualHardDiskDeserializer(item["vhd"]), + image: !item["image"] ? item["image"] : virtualHardDiskDeserializer(item["image"]), + caching: item["caching"], + writeAcceleratorEnabled: item["writeAcceleratorEnabled"], + diffDiskSettings: !item["diffDiskSettings"] + ? item["diffDiskSettings"] + : diffDiskSettingsDeserializer(item["diffDiskSettings"]), + createOption: item["createOption"], + diskSizeGB: item["diskSizeGB"], + managedDisk: !item["managedDisk"] + ? item["managedDisk"] + : managedDiskParametersDeserializer(item["managedDisk"]), + deleteOption: item["deleteOption"], + }; +} + +/** This property allows you to specify the supported type of the OS that application is built for. Possible values are: **Windows,** **Linux.** */ +export enum KnownOperatingSystemTypes { + /** Windows OS */ + Windows = "Windows", + /** Linux OS */ + Linux = "Linux", +} + +/** + * This property allows you to specify the supported type of the OS that application is built for. Possible values are: **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 OS \ + * **Linux**: Linux OS + */ +export type OperatingSystemTypes = string; + +/** Describes a Encryption Settings for a Disk */ +export interface DiskEncryptionSettings { + /** Specifies the location of the disk encryption key, which is a Key Vault Secret. */ + diskEncryptionKey?: KeyVaultSecretReference; + /** Specifies the location of the key encryption key in Key Vault. */ + keyEncryptionKey?: KeyVaultKeyReference; + /** Specifies whether disk encryption should be enabled on the virtual machine. */ + enabled?: boolean; +} + +export function diskEncryptionSettingsSerializer(item: DiskEncryptionSettings): any { + return { + diskEncryptionKey: !item["diskEncryptionKey"] + ? item["diskEncryptionKey"] + : keyVaultSecretReferenceSerializer(item["diskEncryptionKey"]), + keyEncryptionKey: !item["keyEncryptionKey"] + ? item["keyEncryptionKey"] + : keyVaultKeyReferenceSerializer(item["keyEncryptionKey"]), + enabled: item["enabled"], + }; +} + +export function diskEncryptionSettingsDeserializer(item: any): DiskEncryptionSettings { + return { + diskEncryptionKey: !item["diskEncryptionKey"] + ? item["diskEncryptionKey"] + : keyVaultSecretReferenceDeserializer(item["diskEncryptionKey"]), + keyEncryptionKey: !item["keyEncryptionKey"] + ? item["keyEncryptionKey"] + : keyVaultKeyReferenceDeserializer(item["keyEncryptionKey"]), + enabled: item["enabled"], + }; +} + +/** Describes a reference to Key Vault Secret */ +export interface KeyVaultSecretReference { + /** The URL referencing a secret in a Key Vault. */ + secretUrl: string; + /** The relative URL of the Key Vault containing the secret. */ + sourceVault: SubResource; +} + +export function keyVaultSecretReferenceSerializer(item: KeyVaultSecretReference): any { + return { secretUrl: item["secretUrl"], sourceVault: subResourceSerializer(item["sourceVault"]) }; +} + +export function keyVaultSecretReferenceDeserializer(item: any): KeyVaultSecretReference { + return { + secretUrl: item["secretUrl"], + sourceVault: subResourceDeserializer(item["sourceVault"]), + }; +} + +/** Describes a reference to a sub-resource. */ +export interface SubResource { + /** The ID of the sub-resource. */ + id?: string; +} + +export function subResourceSerializer(item: SubResource): any { + return { id: item["id"] }; +} + +export function subResourceDeserializer(item: any): SubResource { + return { + id: item["id"], + }; +} + +/** Describes a reference to Key Vault Key */ +export interface KeyVaultKeyReference { + /** The URL referencing a key encryption key in Key Vault. */ + keyUrl: string; + /** The relative URL of the Key Vault containing the key. */ + sourceVault: SubResource; +} + +export function keyVaultKeyReferenceSerializer(item: KeyVaultKeyReference): any { + return { keyUrl: item["keyUrl"], sourceVault: subResourceSerializer(item["sourceVault"]) }; +} + +export function keyVaultKeyReferenceDeserializer(item: any): KeyVaultKeyReference { + return { + keyUrl: item["keyUrl"], + sourceVault: subResourceDeserializer(item["sourceVault"]), + }; +} + +/** Describes the uri of a disk. */ +export interface VirtualHardDisk { + /** Specifies the virtual hard disk's uri. */ + uri?: string; +} + +export function virtualHardDiskSerializer(item: VirtualHardDisk): any { + return { uri: item["uri"] }; +} + +export function virtualHardDiskDeserializer(item: any): VirtualHardDisk { + return { + uri: item["uri"], + }; +} + +/** Specifies the caching requirements. Possible values are: **None,** **ReadOnly,** **ReadWrite.** The default values are: **None for Standard storage. ReadOnly for Premium storage** */ +export enum KnownCachingTypes { + /** Caching type:None */ + None = "None", + /** Caching type:ReadOnly */ + ReadOnly = "ReadOnly", + /** Caching type:ReadWrite */ + ReadWrite = "ReadWrite", +} + +/** + * Specifies the caching requirements. Possible values are: **None,** **ReadOnly,** **ReadWrite.** The default values are: **None for Standard storage. ReadOnly for Premium storage** \ + * {@link KnownCachingTypes} can be used interchangeably with CachingTypes, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **None**: Caching type:None \ + * **ReadOnly**: Caching type:ReadOnly \ + * **ReadWrite**: Caching type:ReadWrite + */ +export type CachingTypes = string; + +/** Describes the parameters of ephemeral disk settings that can be specified for operating system disk. Note: The ephemeral disk settings can only be specified for managed disk. */ +export interface DiffDiskSettings { + /** Specifies the ephemeral disk settings for operating system disk. */ + option?: DiffDiskOptions; + /** Specifies the ephemeral disk placement for operating system disk. Possible values are: CacheDisk, ResourceDisk, NvmeDisk. The defaulting behavior is: CacheDisk if one is configured for the VM size otherwise ResourceDisk or NvmeDisk is used. Minimum api-version for NvmeDisk: 2024-03-01. */ + placement?: DiffDiskPlacement; +} + +export function diffDiskSettingsSerializer(item: DiffDiskSettings): any { + return { option: item["option"], placement: item["placement"] }; +} + +export function diffDiskSettingsDeserializer(item: any): DiffDiskSettings { + return { + option: item["option"], + placement: item["placement"], + }; +} + +/** Specifies the ephemeral disk option for operating system disk. */ +export enum KnownDiffDiskOptions { + /** Local Ephemeral disk option: Local */ + Local = "Local", +} + +/** + * Specifies the ephemeral disk option for operating system disk. \ + * {@link KnownDiffDiskOptions} can be used interchangeably with DiffDiskOptions, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Local**: Local Ephemeral disk option: Local + */ +export type DiffDiskOptions = string; + +/** Specifies the ephemeral disk placement for operating system disk. This property can be used by user in the request to choose the location i.e, cache disk, resource disk or nvme disk space for Ephemeral OS disk provisioning. For more information on Ephemeral OS disk size requirements, please refer Ephemeral OS disk size requirements for Windows VM at https://docs.microsoft.com/azure/virtual-machines/windows/ephemeral-os-disks#size-requirements and Linux VM at https://docs.microsoft.com/azure/virtual-machines/linux/ephemeral-os-disks#size-requirements. Minimum api-version for NvmeDisk: 2024-03-01. */ +export enum KnownDiffDiskPlacement { + /** CacheDisk disk placement */ + CacheDisk = "CacheDisk", + /** ResourceDisk disk placement */ + ResourceDisk = "ResourceDisk", + /** NvmeDisk disk placement */ + NvmeDisk = "NvmeDisk", +} + +/** + * Specifies the ephemeral disk placement for operating system disk. This property can be used by user in the request to choose the location i.e, cache disk, resource disk or nvme disk space for Ephemeral OS disk provisioning. For more information on Ephemeral OS disk size requirements, please refer Ephemeral OS disk size requirements for Windows VM at https://docs.microsoft.com/azure/virtual-machines/windows/ephemeral-os-disks#size-requirements and Linux VM at https://docs.microsoft.com/azure/virtual-machines/linux/ephemeral-os-disks#size-requirements. Minimum api-version for NvmeDisk: 2024-03-01. \ + * {@link KnownDiffDiskPlacement} can be used interchangeably with DiffDiskPlacement, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **CacheDisk**: CacheDisk disk placement \ + * **ResourceDisk**: ResourceDisk disk placement \ + * **NvmeDisk**: NvmeDisk disk placement + */ +export type DiffDiskPlacement = string; + +/** Specifies how the virtual machine disk should be created. Possible values are **Attach:** This value is used when you are using a specialized disk to create the virtual machine. **FromImage:** This value is used when you are using an image to create the virtual machine. If you are using a platform image, you should also use the imageReference element described above. If you are using a marketplace image, you should also use the plan element previously described. **Empty:** This value is used when creating an empty data disk. **Copy:** This value is used to create a data disk from a snapshot or another disk. **Restore:** This value is used to create a data disk from a disk restore point. */ +export enum KnownDiskCreateOptionTypes { + /** Create disk FromImage */ + FromImage = "FromImage", + /** Empty value */ + Empty = "Empty", + /** Create disk by Attach */ + Attach = "Attach", + /** Create disk by Copy */ + Copy = "Copy", + /** Create disk by Restore */ + Restore = "Restore", +} + +/** + * Specifies how the virtual machine disk should be created. Possible values are **Attach:** This value is used when you are using a specialized disk to create the virtual machine. **FromImage:** This value is used when you are using an image to create the virtual machine. If you are using a platform image, you should also use the imageReference element described above. If you are using a marketplace image, you should also use the plan element previously described. **Empty:** This value is used when creating an empty data disk. **Copy:** This value is used to create a data disk from a snapshot or another disk. **Restore:** This value is used to create a data disk from a disk restore point. \ + * {@link KnownDiskCreateOptionTypes} can be used interchangeably with DiskCreateOptionTypes, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **FromImage**: Create disk FromImage \ + * **Empty**: Empty value \ + * **Attach**: Create disk by Attach \ + * **Copy**: Create disk by Copy \ + * **Restore**: Create disk by Restore + */ +export type DiskCreateOptionTypes = string; + +/** The parameters of a managed disk. */ +export interface ManagedDiskParameters extends SubResource { + /** Specifies the storage account type for the managed disk. NOTE: UltraSSD_LRS can only be used with data disks, it cannot be used with OS Disk. */ + storageAccountType?: StorageAccountTypes; + /** Specifies the customer managed disk encryption set resource id for the managed disk. */ + diskEncryptionSet?: DiskEncryptionSetParameters; + /** Specifies the security profile for the managed disk. */ + securityProfile?: VMDiskSecurityProfile; +} + +export function managedDiskParametersSerializer(item: ManagedDiskParameters): any { + return { + id: item["id"], + storageAccountType: item["storageAccountType"], + diskEncryptionSet: !item["diskEncryptionSet"] + ? item["diskEncryptionSet"] + : diskEncryptionSetParametersSerializer(item["diskEncryptionSet"]), + securityProfile: !item["securityProfile"] + ? item["securityProfile"] + : vmDiskSecurityProfileSerializer(item["securityProfile"]), + }; +} + +export function managedDiskParametersDeserializer(item: any): ManagedDiskParameters { + return { + id: item["id"], + storageAccountType: item["storageAccountType"], + diskEncryptionSet: !item["diskEncryptionSet"] + ? item["diskEncryptionSet"] + : diskEncryptionSetParametersDeserializer(item["diskEncryptionSet"]), + securityProfile: !item["securityProfile"] + ? item["securityProfile"] + : vmDiskSecurityProfileDeserializer(item["securityProfile"]), + }; +} + +/** Specifies the storage account type for the managed disk. Managed OS disk storage account type can only be set when you create the scale set. NOTE: UltraSSD_LRS can only be used with data disks. It cannot be used with OS Disk. Standard_LRS uses Standard HDD. StandardSSD_LRS uses Standard SSD. Premium_LRS uses Premium SSD. UltraSSD_LRS uses Ultra disk. Premium_ZRS uses Premium SSD zone redundant storage. StandardSSD_ZRS uses Standard SSD zone redundant storage. For more information regarding disks supported for Windows Virtual Machines, refer to https://docs.microsoft.com/azure/virtual-machines/windows/disks-types and, for Linux Virtual Machines, refer to https://docs.microsoft.com/azure/virtual-machines/linux/disks-types */ +export enum KnownStorageAccountTypes { + /** Standard_LRS storage account type */ + StandardLRS = "Standard_LRS", + /** Premium_LRS storage account type */ + PremiumLRS = "Premium_LRS", + /** StandardSSD_LRS storage account type */ + StandardSSDLRS = "StandardSSD_LRS", + /** UltraSSD_LRS storage account type */ + UltraSSDLRS = "UltraSSD_LRS", + /** Premium_ZRS storage account type */ + PremiumZRS = "Premium_ZRS", + /** StandardSSD_ZRS storage account type */ + StandardSSDZRS = "StandardSSD_ZRS", + /** PremiumV2_LRS storage account type */ + PremiumV2LRS = "PremiumV2_LRS", +} + +/** + * Specifies the storage account type for the managed disk. Managed OS disk storage account type can only be set when you create the scale set. NOTE: UltraSSD_LRS can only be used with data disks. It cannot be used with OS Disk. Standard_LRS uses Standard HDD. StandardSSD_LRS uses Standard SSD. Premium_LRS uses Premium SSD. UltraSSD_LRS uses Ultra disk. Premium_ZRS uses Premium SSD zone redundant storage. StandardSSD_ZRS uses Standard SSD zone redundant storage. For more information regarding disks supported for Windows Virtual Machines, refer to https://docs.microsoft.com/azure/virtual-machines/windows/disks-types and, for Linux Virtual Machines, refer to https://docs.microsoft.com/azure/virtual-machines/linux/disks-types \ + * {@link KnownStorageAccountTypes} can be used interchangeably with StorageAccountTypes, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Standard_LRS**: Standard_LRS storage account type \ + * **Premium_LRS**: Premium_LRS storage account type \ + * **StandardSSD_LRS**: StandardSSD_LRS storage account type \ + * **UltraSSD_LRS**: UltraSSD_LRS storage account type \ + * **Premium_ZRS**: Premium_ZRS storage account type \ + * **StandardSSD_ZRS**: StandardSSD_ZRS storage account type \ + * **PremiumV2_LRS**: PremiumV2_LRS storage account type + */ +export type StorageAccountTypes = string; + +/** Describes the parameter of customer managed disk encryption set resource id that can be specified for disk. **Note:** The disk encryption set resource id can only be specified for managed disk. Please refer https://aka.ms/mdssewithcmkoverview for more details. */ +export interface DiskEncryptionSetParameters extends SubResource {} + +export function diskEncryptionSetParametersSerializer(item: DiskEncryptionSetParameters): any { + return { id: item["id"] }; +} + +export function diskEncryptionSetParametersDeserializer(item: any): DiskEncryptionSetParameters { + return { + id: item["id"], + }; +} + +/** 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 DiskWithVMGuestState for encryption of the managed disk along with VMGuestState blob, VMGuestStateOnly for encryption of just the VMGuestState blob, and NonPersistedTPM for not persisting firmware state in the VMGuestState blob.. **Note:** It can be set for only Confidential VMs. */ + securityEncryptionType?: SecurityEncryptionTypes; + /** Specifies the customer managed disk encryption set resource id for the managed disk that is used for Customer Managed Key encrypted ConfidentialVM OS Disk and VMGuest blob. */ + diskEncryptionSet?: DiskEncryptionSetParameters; +} + +export function vmDiskSecurityProfileSerializer(item: VMDiskSecurityProfile): any { + return { + securityEncryptionType: item["securityEncryptionType"], + diskEncryptionSet: !item["diskEncryptionSet"] + ? item["diskEncryptionSet"] + : diskEncryptionSetParametersSerializer(item["diskEncryptionSet"]), + }; +} + +export function vmDiskSecurityProfileDeserializer(item: any): VMDiskSecurityProfile { + return { + securityEncryptionType: item["securityEncryptionType"], + diskEncryptionSet: !item["diskEncryptionSet"] + ? item["diskEncryptionSet"] + : diskEncryptionSetParametersDeserializer(item["diskEncryptionSet"]), + }; +} + +/** Specifies the EncryptionType of the managed disk. It is set to DiskWithVMGuestState for encryption of the managed disk along with VMGuestState blob, VMGuestStateOnly for encryption of just the VMGuestState blob, and NonPersistedTPM for not persisting firmware state in the VMGuestState blob.. **Note:** It can be set for only Confidential VMs. */ +export enum KnownSecurityEncryptionTypes { + /** VMGuestStateOnly encryption */ + VMGuestStateOnly = "VMGuestStateOnly", + /** DiskWithVMGuestState encryption */ + DiskWithVMGuestState = "DiskWithVMGuestState", + /** NonPersistedTPM encryption */ + NonPersistedTPM = "NonPersistedTPM", +} + +/** + * Specifies the EncryptionType of the managed disk. It is set to DiskWithVMGuestState for encryption of the managed disk along with VMGuestState blob, VMGuestStateOnly for encryption of just the VMGuestState blob, and NonPersistedTPM for not persisting firmware state in the VMGuestState blob.. **Note:** It can be set for only Confidential VMs. \ + * {@link KnownSecurityEncryptionTypes} can be used interchangeably with SecurityEncryptionTypes, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **VMGuestStateOnly**: VMGuestStateOnly encryption \ + * **DiskWithVMGuestState**: DiskWithVMGuestState encryption \ + * **NonPersistedTPM**: NonPersistedTPM encryption + */ +export type SecurityEncryptionTypes = string; + +/** Specifies the behavior of the managed disk when the VM gets deleted, for example whether the managed disk is deleted or detached. Supported values are: **Delete.** If this value is used, the managed disk is deleted when VM gets deleted. **Detach.** If this value is used, the managed disk is retained after VM gets deleted. Minimum api-version: 2021-03-01. */ +export enum KnownDiskDeleteOptionTypes { + /** Delete the disk upon VM deletion */ + Delete = "Delete", + /** Detach the disk upon VM deletion */ + Detach = "Detach", +} + +/** + * Specifies the behavior of the managed disk when the VM gets deleted, for example whether the managed disk is deleted or detached. Supported values are: **Delete.** If this value is used, the managed disk is deleted when VM gets deleted. **Detach.** If this value is used, the managed disk is retained after VM gets deleted. Minimum api-version: 2021-03-01. \ + * {@link KnownDiskDeleteOptionTypes} can be used interchangeably with DiskDeleteOptionTypes, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Delete**: Delete the disk upon VM deletion \ + * **Detach**: Detach the disk upon VM deletion + */ +export type DiskDeleteOptionTypes = string; + +export function dataDiskArraySerializer(result: Array): any[] { + return result.map((item) => { + return dataDiskSerializer(item); + }); +} + +export function dataDiskArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return dataDiskDeserializer(item); + }); +} + +/** Describes a data disk. */ +export interface DataDisk { + /** Specifies the logical unit number of the data disk. This value is used to identify data disks within the VM and therefore must be unique for each data disk attached to a VM. */ + lun: number; + /** The disk name. */ + name?: string; + /** The virtual hard disk. */ + vhd?: VirtualHardDisk; + /** The source user image virtual hard disk. The virtual hard disk will be copied before being attached to the virtual machine. If SourceImage is provided, the destination virtual hard drive must not exist. */ + image?: VirtualHardDisk; + /** Specifies the caching requirements. Possible values are: None, ReadOnly, ReadWrite. The defaulting behavior is: None for Standard storage. ReadOnly for Premium storage. */ + caching?: CachingTypes; + /** Specifies whether writeAccelerator should be enabled or disabled on the disk. */ + writeAcceleratorEnabled?: boolean; + /** Specifies how the virtual machine disk should be created. Possible values are Attach, FromImage, Empty, Copy, Restore. */ + createOption: DiskCreateOptionTypes; + /** Specifies the size of an empty data disk in gigabytes. This element can be used to overwrite the size of the disk in a virtual machine image. The property 'diskSizeGB' is the number of bytes x 1024^3 for the disk and the value cannot be larger than 1023. */ + diskSizeGB?: number; + /** The managed disk parameters. */ + managedDisk?: ManagedDiskParameters; + /** The source resource identifier. It can be a snapshot, or disk restore point from which to create a disk. */ + sourceResource?: ApiEntityReference; + /** Specifies whether the data disk is in process of detachment from the VirtualMachine/VirtualMachineScaleset. */ + toBeDetached?: boolean; + /** Specifies the detach behavior to be used while detaching a disk or which is already in the process of detachment from the virtual machine. Supported values: ForceDetach. This feature is still in preview. To force-detach a data disk update toBeDetached to 'true' along with setting detachOption: 'ForceDetach'. */ + detachOption?: DiskDetachOptionTypes; + /** Specifies whether data disk should be deleted or detached upon VM deletion. Possible values are: Delete, Detach. The default value is set to Detach. */ + deleteOption?: DiskDeleteOptionTypes; +} + +export function dataDiskSerializer(item: DataDisk): any { + return { + lun: item["lun"], + name: item["name"], + vhd: !item["vhd"] ? item["vhd"] : virtualHardDiskSerializer(item["vhd"]), + image: !item["image"] ? item["image"] : virtualHardDiskSerializer(item["image"]), + caching: item["caching"], + writeAcceleratorEnabled: item["writeAcceleratorEnabled"], + createOption: item["createOption"], + diskSizeGB: item["diskSizeGB"], + managedDisk: !item["managedDisk"] + ? item["managedDisk"] + : managedDiskParametersSerializer(item["managedDisk"]), + sourceResource: !item["sourceResource"] + ? item["sourceResource"] + : apiEntityReferenceSerializer(item["sourceResource"]), + toBeDetached: item["toBeDetached"], + detachOption: item["detachOption"], + deleteOption: item["deleteOption"], + }; +} + +export function dataDiskDeserializer(item: any): DataDisk { + return { + lun: item["lun"], + name: item["name"], + vhd: !item["vhd"] ? item["vhd"] : virtualHardDiskDeserializer(item["vhd"]), + image: !item["image"] ? item["image"] : virtualHardDiskDeserializer(item["image"]), + caching: item["caching"], + writeAcceleratorEnabled: item["writeAcceleratorEnabled"], + createOption: item["createOption"], + diskSizeGB: item["diskSizeGB"], + managedDisk: !item["managedDisk"] + ? item["managedDisk"] + : managedDiskParametersDeserializer(item["managedDisk"]), + sourceResource: !item["sourceResource"] + ? item["sourceResource"] + : apiEntityReferenceDeserializer(item["sourceResource"]), + toBeDetached: item["toBeDetached"], + detachOption: item["detachOption"], + deleteOption: item["deleteOption"], + }; +} + +/** The API entity reference. */ +export interface ApiEntityReference { + /** The ARM resource id in the form of /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/... */ + id?: string; +} + +export function apiEntityReferenceSerializer(item: ApiEntityReference): any { + return { id: item["id"] }; +} + +export function apiEntityReferenceDeserializer(item: any): ApiEntityReference { + return { + id: item["id"], + }; +} + +/** Specifies the detach behavior to be used while detaching a disk or which is already in the process of detachment from the virtual machine. Supported values are: **ForceDetach.** detachOption: **ForceDetach** is applicable only for managed data disks. If a previous detachment attempt of the data disk did not complete due to an unexpected failure from the virtual machine and the disk is still not released then use force-detach as a last resort option to detach the disk forcibly from the VM. All writes might not have been flushed when using this detach behavior. **This feature is still in preview**. To force-detach a data disk update toBeDetached to 'true' along with setting detachOption: 'ForceDetach'. */ +export enum KnownDiskDetachOptionTypes { + /** ForceDetach the disk */ + ForceDetach = "ForceDetach", +} + +/** + * Specifies the detach behavior to be used while detaching a disk or which is already in the process of detachment from the virtual machine. Supported values are: **ForceDetach.** detachOption: **ForceDetach** is applicable only for managed data disks. If a previous detachment attempt of the data disk did not complete due to an unexpected failure from the virtual machine and the disk is still not released then use force-detach as a last resort option to detach the disk forcibly from the VM. All writes might not have been flushed when using this detach behavior. **This feature is still in preview**. To force-detach a data disk update toBeDetached to 'true' along with setting detachOption: 'ForceDetach'. \ + * {@link KnownDiskDetachOptionTypes} can be used interchangeably with DiskDetachOptionTypes, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **ForceDetach**: ForceDetach the disk + */ +export type DiskDetachOptionTypes = string; + +/** Specifies the disk controller type configured for the VM and VirtualMachineScaleSet. This property is only supported for virtual machines whose operating system disk and VM sku supports Generation 2 (https://docs.microsoft.com/en-us/azure/virtual-machines/generation-2), please check the HyperVGenerations capability returned as part of VM sku capabilities in the response of Microsoft.Compute SKUs api for the region contains V2 (https://docs.microsoft.com/rest/api/compute/resourceskus/list). For more information about Disk Controller Types supported please refer to https://aka.ms/azure-diskcontrollertypes. */ +export enum KnownDiskControllerTypes { + /** SCSI disk controller type */ + Scsi = "SCSI", + /** NVMe disk controller type */ + NVMe = "NVMe", +} + +/** + * Specifies the disk controller type configured for the VM and VirtualMachineScaleSet. This property is only supported for virtual machines whose operating system disk and VM sku supports Generation 2 (https://docs.microsoft.com/en-us/azure/virtual-machines/generation-2), please check the HyperVGenerations capability returned as part of VM sku capabilities in the response of Microsoft.Compute SKUs api for the region contains V2 (https://docs.microsoft.com/rest/api/compute/resourceskus/list). For more information about Disk Controller Types supported please refer to https://aka.ms/azure-diskcontrollertypes. \ + * {@link KnownDiskControllerTypes} can be used interchangeably with DiskControllerTypes, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **SCSI**: SCSI disk controller type \ + * **NVMe**: NVMe disk controller type + */ +export type DiskControllerTypes = string; + +/** Enables or disables a capability on the virtual machine or virtual machine scale set. */ +export interface AdditionalCapabilities { + /** The flag that enables or disables a capability to have one or more managed data disks with UltraSSD_LRS storage account type on the VM or VMSS. Managed disks with storage account type UltraSSD_LRS can be added to a virtual machine or virtual machine scale set only if this property is enabled. */ + ultraSSDEnabled?: boolean; + /** The flag that enables or disables hibernation capability on the VM. */ + hibernationEnabled?: boolean; +} + +export function additionalCapabilitiesSerializer(item: AdditionalCapabilities): any { + return { + ultraSSDEnabled: item["ultraSSDEnabled"], + hibernationEnabled: item["hibernationEnabled"], + }; +} + +export function additionalCapabilitiesDeserializer(item: any): AdditionalCapabilities { + return { + ultraSSDEnabled: item["ultraSSDEnabled"], + hibernationEnabled: item["hibernationEnabled"], + }; +} + +/** Specifies the operating system settings for the virtual machine. Some of the settings cannot be changed once VM is provisioned. */ +export interface OSProfile { + /** Specifies the host OS name of the virtual machine. This name cannot be updated after the VM is created. **Max-length (Windows):** 15 characters. **Max-length (Linux):** 64 characters. For naming conventions and restrictions see [Azure infrastructure services implementation guidelines](https://docs.microsoft.com/azure/azure-resource-manager/management/resource-name-rules). */ + computerName?: string; + /** Specifies the name of the administrator account.

This property cannot be updated after the VM is created.

**Windows-only restriction:** Cannot end in "."

**Disallowed values:** "administrator", "admin", "user", "user1", "test", "user2", "test1", "user3", "admin1", "1", "123", "a", "actuser", "adm", "admin2", "aspnet", "backup", "console", "david", "guest", "john", "owner", "root", "server", "sql", "support", "support_388945a0", "sys", "test2", "test3", "user4", "user5".

**Minimum-length (Linux):** 1 character

**Max-length (Linux):** 64 characters

**Max-length (Windows):** 20 characters. */ + adminUsername?: string; + /** Specifies the password of the administrator account.

**Minimum-length (Windows):** 8 characters

**Minimum-length (Linux):** 6 characters

**Max-length (Windows):** 123 characters

**Max-length (Linux):** 72 characters

**Complexity requirements:** 3 out of 4 conditions below need to be fulfilled
Has lower characters
Has upper characters
Has a digit
Has a special character (Regex match [\W_])

**Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!"

For resetting the password, see [How to reset the Remote Desktop service or its login password in a Windows VM](https://docs.microsoft.com/troubleshoot/azure/virtual-machines/reset-rdp)

For resetting root password, see [Manage users, SSH, and check or repair disks on Azure Linux VMs using the VMAccess Extension](https://docs.microsoft.com/troubleshoot/azure/virtual-machines/troubleshoot-ssh-connection) */ + adminPassword?: string; + /** Specifies a base-64 encoded string of custom data. The base-64 encoded string is decoded to a binary array that is saved as a file on the Virtual Machine. The maximum length of the binary array is 65535 bytes. **Note: Do not pass any secrets or passwords in customData property.** This property cannot be updated after the VM is created. The property 'customData' is passed to the VM to be saved as a file, for more information see [Custom Data on Azure VMs](https://azure.microsoft.com/blog/custom-data-and-cloud-init-on-windows-azure/). For using cloud-init for your Linux VM, see [Using cloud-init to customize a Linux VM during creation](https://docs.microsoft.com/azure/virtual-machines/linux/using-cloud-init). */ + customData?: string; + /** Specifies Windows operating system settings on the virtual machine. */ + windowsConfiguration?: WindowsConfiguration; + /** Specifies the Linux operating system settings on the virtual machine. For a list of supported Linux distributions, see [Linux on Azure-Endorsed Distributions](https://docs.microsoft.com/azure/virtual-machines/linux/endorsed-distros). */ + linuxConfiguration?: LinuxConfiguration; + /** Specifies set of certificates that should be installed onto the virtual machine. To install certificates on a virtual machine it is recommended to use the [Azure Key Vault virtual machine extension for Linux](https://docs.microsoft.com/azure/virtual-machines/extensions/key-vault-linux) or the [Azure Key Vault virtual machine extension for Windows](https://docs.microsoft.com/azure/virtual-machines/extensions/key-vault-windows). */ + secrets?: VaultSecretGroup[]; + /** Specifies whether extension operations should be allowed on the virtual machine. This may only be set to False when no extensions are present on the virtual machine. */ + allowExtensionOperations?: boolean; + /** Optional property which must either be set to True or omitted. */ + requireGuestProvisionSignal?: boolean; +} + +export function osProfileSerializer(item: OSProfile): any { + return { + computerName: item["computerName"], + adminUsername: item["adminUsername"], + adminPassword: item["adminPassword"], + customData: item["customData"], + windowsConfiguration: !item["windowsConfiguration"] + ? item["windowsConfiguration"] + : windowsConfigurationSerializer(item["windowsConfiguration"]), + linuxConfiguration: !item["linuxConfiguration"] + ? item["linuxConfiguration"] + : linuxConfigurationSerializer(item["linuxConfiguration"]), + secrets: !item["secrets"] ? item["secrets"] : vaultSecretGroupArraySerializer(item["secrets"]), + allowExtensionOperations: item["allowExtensionOperations"], + requireGuestProvisionSignal: item["requireGuestProvisionSignal"], + }; +} + +export function osProfileDeserializer(item: any): OSProfile { + return { + computerName: item["computerName"], + adminUsername: item["adminUsername"], + adminPassword: item["adminPassword"], + customData: item["customData"], + windowsConfiguration: !item["windowsConfiguration"] + ? item["windowsConfiguration"] + : windowsConfigurationDeserializer(item["windowsConfiguration"]), + linuxConfiguration: !item["linuxConfiguration"] + ? item["linuxConfiguration"] + : linuxConfigurationDeserializer(item["linuxConfiguration"]), + secrets: !item["secrets"] + ? item["secrets"] + : vaultSecretGroupArrayDeserializer(item["secrets"]), + allowExtensionOperations: item["allowExtensionOperations"], + requireGuestProvisionSignal: item["requireGuestProvisionSignal"], + }; +} + +/** Specifies Windows operating system settings on the virtual machine. */ +export interface WindowsConfiguration { + /** Indicates whether virtual machine agent should be provisioned on the virtual machine. When this property is not specified in the request body, it is set to true by default. This will ensure that VM Agent is installed on the VM so that extensions can be added to the VM later. */ + provisionVMAgent?: boolean; + /** Indicates whether Automatic Updates is enabled for the Windows virtual machine. Default value is true. For virtual machine scale sets, this property can be updated and updates will take effect on OS reprovisioning. */ + enableAutomaticUpdates?: boolean; + /** Specifies the time zone of the virtual machine. e.g. "Pacific Standard Time". Possible values can be [TimeZoneInfo.Id](https://docs.microsoft.com/dotnet/api/system.timezoneinfo.id?#System_TimeZoneInfo_Id) value from time zones returned by [TimeZoneInfo.GetSystemTimeZones](https://docs.microsoft.com/dotnet/api/system.timezoneinfo.getsystemtimezones). */ + timeZone?: string; + /** Specifies additional base-64 encoded XML formatted information that can be included in the Unattend.xml file, which is used by Windows Setup. */ + additionalUnattendContent?: AdditionalUnattendContent[]; + /** [Preview Feature] Specifies settings related to VM Guest Patching on Windows. */ + patchSettings?: PatchSettings; + /** Specifies the Windows Remote Management listeners. This enables remote Windows PowerShell. */ + winRM?: WinRMConfiguration; +} + +export function windowsConfigurationSerializer(item: WindowsConfiguration): any { + return { + provisionVMAgent: item["provisionVMAgent"], + enableAutomaticUpdates: item["enableAutomaticUpdates"], + timeZone: item["timeZone"], + additionalUnattendContent: !item["additionalUnattendContent"] + ? item["additionalUnattendContent"] + : additionalUnattendContentArraySerializer(item["additionalUnattendContent"]), + patchSettings: !item["patchSettings"] + ? item["patchSettings"] + : patchSettingsSerializer(item["patchSettings"]), + winRM: !item["winRM"] ? item["winRM"] : winRMConfigurationSerializer(item["winRM"]), + }; +} + +export function windowsConfigurationDeserializer(item: any): WindowsConfiguration { + return { + provisionVMAgent: item["provisionVMAgent"], + enableAutomaticUpdates: item["enableAutomaticUpdates"], + timeZone: item["timeZone"], + additionalUnattendContent: !item["additionalUnattendContent"] + ? item["additionalUnattendContent"] + : additionalUnattendContentArrayDeserializer(item["additionalUnattendContent"]), + patchSettings: !item["patchSettings"] + ? item["patchSettings"] + : patchSettingsDeserializer(item["patchSettings"]), + winRM: !item["winRM"] ? item["winRM"] : winRMConfigurationDeserializer(item["winRM"]), + }; +} + +export function additionalUnattendContentArraySerializer( + result: Array, +): any[] { + return result.map((item) => { + return additionalUnattendContentSerializer(item); + }); +} + +export function additionalUnattendContentArrayDeserializer( + result: Array, +): any[] { + return result.map((item) => { + return additionalUnattendContentDeserializer(item); + }); +} + +/** Specifies additional XML formatted information that can be included in the Unattend.xml file, which is used by Windows Setup. Contents are defined by setting name, component name, and the pass in which the content is applied. */ +export interface AdditionalUnattendContent { + /** The pass name. Currently, the only allowable value is OobeSystem. */ + passName?: "OobeSystem"; + /** The component name. Currently, the only allowable value is Microsoft-Windows-Shell-Setup. */ + componentName?: "Microsoft-Windows-Shell-Setup"; + /** Specifies the name of the setting to which the content applies. Possible values are: FirstLogonCommands and AutoLogon. */ + settingName?: SettingNames; + /** Specifies the XML formatted content that is added to the unattend.xml file for the specified path and component. The XML must be less than 4KB and must include the root element for the setting or feature that is being inserted. */ + content?: string; +} + +export function additionalUnattendContentSerializer(item: AdditionalUnattendContent): any { + return { + passName: item["passName"], + componentName: item["componentName"], + settingName: item["settingName"], + content: item["content"], + }; +} + +export function additionalUnattendContentDeserializer(item: any): AdditionalUnattendContent { + return { + passName: item["passName"], + componentName: item["componentName"], + settingName: item["settingName"], + content: item["content"], + }; +} + +/** Specifies the name of the setting to which the content applies. Possible values are: FirstLogonCommands and AutoLogon. */ +export enum KnownSettingNames { + /** AutoLogon mode */ + AutoLogon = "AutoLogon", + /** FirstLogonCommands mode */ + FirstLogonCommands = "FirstLogonCommands", +} + +/** + * Specifies the name of the setting to which the content applies. Possible values are: FirstLogonCommands and AutoLogon. \ + * {@link KnownSettingNames} can be used interchangeably with SettingNames, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **AutoLogon**: AutoLogon mode \ + * **FirstLogonCommands**: FirstLogonCommands mode + */ +export type SettingNames = string; + +/** Specifies settings related to VM Guest Patching on Windows. */ +export interface PatchSettings { + /** Specifies the mode of VM Guest Patching to IaaS virtual machine or virtual machines associated to virtual machine scale set with OrchestrationMode as Flexible.

Possible values are:

**Manual** - You control the application of patches to a virtual machine. You do this by applying patches manually inside the VM. In this mode, automatic updates are disabled; the property WindowsConfiguration.enableAutomaticUpdates must be false

**AutomaticByOS** - The virtual machine will automatically be updated by the OS. The property WindowsConfiguration.enableAutomaticUpdates must be true.

**AutomaticByPlatform** - the virtual machine will automatically updated by the platform. The properties provisionVMAgent and WindowsConfiguration.enableAutomaticUpdates must be true */ + patchMode?: WindowsVMGuestPatchMode; + /** Enables customers to patch their Azure VMs without requiring a reboot. For enableHotpatching, the 'provisionVMAgent' must be set to true and 'patchMode' must be set to 'AutomaticByPlatform'. */ + enableHotpatching?: boolean; + /** Specifies the mode of VM Guest patch assessment for the IaaS virtual machine.

Possible values are:

**ImageDefault** - You control the timing of patch assessments on a virtual machine.

**AutomaticByPlatform** - The platform will trigger periodic patch assessments. The property provisionVMAgent must be true. */ + assessmentMode?: WindowsPatchAssessmentMode; + /** Specifies additional settings for patch mode AutomaticByPlatform in VM Guest Patching on Windows. */ + automaticByPlatformSettings?: WindowsVMGuestPatchAutomaticByPlatformSettings; +} + +export function patchSettingsSerializer(item: PatchSettings): any { + return { + patchMode: item["patchMode"], + enableHotpatching: item["enableHotpatching"], + assessmentMode: item["assessmentMode"], + automaticByPlatformSettings: !item["automaticByPlatformSettings"] + ? item["automaticByPlatformSettings"] + : windowsVMGuestPatchAutomaticByPlatformSettingsSerializer( + item["automaticByPlatformSettings"], + ), + }; +} + +export function patchSettingsDeserializer(item: any): PatchSettings { + return { + patchMode: item["patchMode"], + enableHotpatching: item["enableHotpatching"], + assessmentMode: item["assessmentMode"], + automaticByPlatformSettings: !item["automaticByPlatformSettings"] + ? item["automaticByPlatformSettings"] + : windowsVMGuestPatchAutomaticByPlatformSettingsDeserializer( + item["automaticByPlatformSettings"], + ), + }; +} + +/** Specifies the mode of VM Guest Patching to IaaS virtual machine or virtual machines associated to virtual machine scale set with OrchestrationMode as Flexible.

Possible values are:

**Manual** - You control the application of patches to a virtual machine. You do this by applying patches manually inside the VM. In this mode, automatic updates are disabled; the property WindowsConfiguration.enableAutomaticUpdates must be false

**AutomaticByOS** - The virtual machine will automatically be updated by the OS. The property WindowsConfiguration.enableAutomaticUpdates must be true.

**AutomaticByPlatform** - the virtual machine will automatically updated by the platform. The properties provisionVMAgent and WindowsConfiguration.enableAutomaticUpdates must be true */ +export enum KnownWindowsVMGuestPatchMode { + /** Manual VM guest patch mode */ + Manual = "Manual", + /** AutomaticByOS VM guest patch mode */ + AutomaticByOS = "AutomaticByOS", + /** AutomaticByPlatform VM guest patch mode */ + AutomaticByPlatform = "AutomaticByPlatform", +} + +/** + * Specifies the mode of VM Guest Patching to IaaS virtual machine or virtual machines associated to virtual machine scale set with OrchestrationMode as Flexible.

Possible values are:

**Manual** - You control the application of patches to a virtual machine. You do this by applying patches manually inside the VM. In this mode, automatic updates are disabled; the property WindowsConfiguration.enableAutomaticUpdates must be false

**AutomaticByOS** - The virtual machine will automatically be updated by the OS. The property WindowsConfiguration.enableAutomaticUpdates must be true.

**AutomaticByPlatform** - the virtual machine will automatically updated by the platform. The properties provisionVMAgent and WindowsConfiguration.enableAutomaticUpdates must be true \ + * {@link KnownWindowsVMGuestPatchMode} can be used interchangeably with WindowsVMGuestPatchMode, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Manual**: Manual VM guest patch mode \ + * **AutomaticByOS**: AutomaticByOS VM guest patch mode \ + * **AutomaticByPlatform**: AutomaticByPlatform VM guest patch mode + */ +export type WindowsVMGuestPatchMode = string; + +/** Specifies the mode of VM Guest patch assessment for the IaaS virtual machine.

Possible values are:

**ImageDefault** - You control the timing of patch assessments on a virtual machine.

**AutomaticByPlatform** - The platform will trigger periodic patch assessments. The property provisionVMAgent must be true. */ +export enum KnownWindowsPatchAssessmentMode { + /** ImageDefault patch assessment mode */ + ImageDefault = "ImageDefault", + /** AutomaticByPlatform patch assessment mode */ + AutomaticByPlatform = "AutomaticByPlatform", +} + +/** + * Specifies the mode of VM Guest patch assessment for the IaaS virtual machine.

Possible values are:

**ImageDefault** - You control the timing of patch assessments on a virtual machine.

**AutomaticByPlatform** - The platform will trigger periodic patch assessments. The property provisionVMAgent must be true. \ + * {@link KnownWindowsPatchAssessmentMode} can be used interchangeably with WindowsPatchAssessmentMode, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **ImageDefault**: ImageDefault patch assessment mode \ + * **AutomaticByPlatform**: AutomaticByPlatform patch assessment mode + */ +export type WindowsPatchAssessmentMode = string; + +/** Specifies additional settings to be applied when patch mode AutomaticByPlatform is selected in Windows patch settings. */ +export interface WindowsVMGuestPatchAutomaticByPlatformSettings { + /** Specifies the reboot setting for all AutomaticByPlatform patch installation operations. */ + rebootSetting?: WindowsVMGuestPatchAutomaticByPlatformRebootSetting; + /** Enables customer to schedule patching without accidental upgrades */ + bypassPlatformSafetyChecksOnUserSchedule?: boolean; +} + +export function windowsVMGuestPatchAutomaticByPlatformSettingsSerializer( + item: WindowsVMGuestPatchAutomaticByPlatformSettings, +): any { + return { + rebootSetting: item["rebootSetting"], + bypassPlatformSafetyChecksOnUserSchedule: item["bypassPlatformSafetyChecksOnUserSchedule"], + }; +} + +export function windowsVMGuestPatchAutomaticByPlatformSettingsDeserializer( + item: any, +): WindowsVMGuestPatchAutomaticByPlatformSettings { + return { + rebootSetting: item["rebootSetting"], + bypassPlatformSafetyChecksOnUserSchedule: item["bypassPlatformSafetyChecksOnUserSchedule"], + }; +} + +/** Specifies the reboot setting for all AutomaticByPlatform patch installation operations. */ +export enum KnownWindowsVMGuestPatchAutomaticByPlatformRebootSetting { + /** Reboot setting for Unknown */ + Unknown = "Unknown", + /** Reboot setting for IfRequired */ + IfRequired = "IfRequired", + /** Reboot setting for Never */ + Never = "Never", + /** Reboot setting for Always */ + Always = "Always", +} + +/** + * Specifies the reboot setting for all AutomaticByPlatform patch installation operations. \ + * {@link KnownWindowsVMGuestPatchAutomaticByPlatformRebootSetting} can be used interchangeably with WindowsVMGuestPatchAutomaticByPlatformRebootSetting, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Unknown**: Reboot setting for Unknown \ + * **IfRequired**: Reboot setting for IfRequired \ + * **Never**: Reboot setting for Never \ + * **Always**: Reboot setting for Always + */ +export type WindowsVMGuestPatchAutomaticByPlatformRebootSetting = string; + +/** Describes Windows Remote Management configuration of the VM */ +export interface WinRMConfiguration { + /** The list of Windows Remote Management listeners */ + listeners?: WinRMListener[]; +} + +export function winRMConfigurationSerializer(item: WinRMConfiguration): any { + return { + listeners: !item["listeners"] + ? item["listeners"] + : winRMListenerArraySerializer(item["listeners"]), + }; +} + +export function winRMConfigurationDeserializer(item: any): WinRMConfiguration { + return { + listeners: !item["listeners"] + ? item["listeners"] + : winRMListenerArrayDeserializer(item["listeners"]), + }; +} + +export function winRMListenerArraySerializer(result: Array): any[] { + return result.map((item) => { + return winRMListenerSerializer(item); + }); +} + +export function winRMListenerArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return winRMListenerDeserializer(item); + }); +} + +/** Describes Protocol and thumbprint of Windows Remote Management listener */ +export interface WinRMListener { + /** Specifies the protocol of WinRM listener. Possible values are: **http,** **https.** */ + protocol?: ProtocolTypes; + /** This is the URL of a certificate that has been uploaded to Key Vault as a secret. For adding a secret to the Key Vault, see [Add a key or secret to the key vault](https://docs.microsoft.com/azure/key-vault/key-vault-get-started/#add). In this case, your certificate needs to be the Base64 encoding of the following JSON Object which is encoded in UTF-8:

{
"data":"",
"dataType":"pfx",
"password":""
}
To install certificates on a virtual machine it is recommended to use the [Azure Key Vault virtual machine extension for Linux](https://docs.microsoft.com/azure/virtual-machines/extensions/key-vault-linux) or the [Azure Key Vault virtual machine extension for Windows](https://docs.microsoft.com/azure/virtual-machines/extensions/key-vault-windows). */ + certificateUrl?: string; +} + +export function winRMListenerSerializer(item: WinRMListener): any { + return { protocol: item["protocol"], certificateUrl: item["certificateUrl"] }; +} + +export function winRMListenerDeserializer(item: any): WinRMListener { + return { + protocol: item["protocol"], + certificateUrl: item["certificateUrl"], + }; +} + +/** Specifies the protocol of WinRM listener. Possible values are: **http,** **https.** */ +export enum KnownProtocolTypes { + /** Http protocol */ + Http = "Http", + /** Https protocol */ + Https = "Https", +} + +/** + * Specifies the protocol of WinRM listener. Possible values are: **http,** **https.** \ + * {@link KnownProtocolTypes} can be used interchangeably with ProtocolTypes, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Http**: Http protocol \ + * **Https**: Https protocol + */ +export type ProtocolTypes = string; + +/** Specifies the Linux operating system settings on the virtual machine. For a list of supported Linux distributions, see [Linux on Azure-Endorsed Distributions](https://docs.microsoft.com/azure/virtual-machines/linux/endorsed-distros). */ +export interface LinuxConfiguration { + /** Specifies whether password authentication should be disabled. */ + disablePasswordAuthentication?: boolean; + /** Specifies the ssh key configuration for a Linux OS. */ + ssh?: SshConfiguration; + /** Indicates whether virtual machine agent should be provisioned on the virtual machine. When this property is not specified in the request body, default behavior is to set it to true. This will ensure that VM Agent is installed on the VM so that extensions can be added to the VM later. */ + provisionVMAgent?: boolean; + /** [Preview Feature] Specifies settings related to VM Guest Patching on Linux. */ + patchSettings?: LinuxPatchSettings; + /** Indicates whether VMAgent Platform Updates is enabled for the Linux virtual machine. Default value is false. */ + enableVMAgentPlatformUpdates?: boolean; +} + +export function linuxConfigurationSerializer(item: LinuxConfiguration): any { + return { + disablePasswordAuthentication: item["disablePasswordAuthentication"], + ssh: !item["ssh"] ? item["ssh"] : sshConfigurationSerializer(item["ssh"]), + provisionVMAgent: item["provisionVMAgent"], + patchSettings: !item["patchSettings"] + ? item["patchSettings"] + : linuxPatchSettingsSerializer(item["patchSettings"]), + enableVMAgentPlatformUpdates: item["enableVMAgentPlatformUpdates"], + }; +} + +export function linuxConfigurationDeserializer(item: any): LinuxConfiguration { + return { + disablePasswordAuthentication: item["disablePasswordAuthentication"], + ssh: !item["ssh"] ? item["ssh"] : sshConfigurationDeserializer(item["ssh"]), + provisionVMAgent: item["provisionVMAgent"], + patchSettings: !item["patchSettings"] + ? item["patchSettings"] + : linuxPatchSettingsDeserializer(item["patchSettings"]), + enableVMAgentPlatformUpdates: item["enableVMAgentPlatformUpdates"], + }; +} + +/** 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://docs.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"], + }; +} + +/** Specifies settings related to VM Guest Patching on Linux. */ +export interface LinuxPatchSettings { + /** Specifies the mode of VM Guest Patching to IaaS virtual machine or virtual machines associated to virtual machine scale set with OrchestrationMode as Flexible.

Possible values are:

**ImageDefault** - The virtual machine's default patching configuration is used.

**AutomaticByPlatform** - The virtual machine will be automatically updated by the platform. The property provisionVMAgent must be true */ + patchMode?: LinuxVMGuestPatchMode; + /** Specifies the mode of VM Guest Patch Assessment for the IaaS virtual machine.

Possible values are:

**ImageDefault** - You control the timing of patch assessments on a virtual machine.

**AutomaticByPlatform** - The platform will trigger periodic patch assessments. The property provisionVMAgent must be true. */ + assessmentMode?: LinuxPatchAssessmentMode; + /** Specifies additional settings for patch mode AutomaticByPlatform in VM Guest Patching on Linux. */ + automaticByPlatformSettings?: LinuxVMGuestPatchAutomaticByPlatformSettings; +} + +export function linuxPatchSettingsSerializer(item: LinuxPatchSettings): any { + return { + patchMode: item["patchMode"], + assessmentMode: item["assessmentMode"], + automaticByPlatformSettings: !item["automaticByPlatformSettings"] + ? item["automaticByPlatformSettings"] + : linuxVMGuestPatchAutomaticByPlatformSettingsSerializer(item["automaticByPlatformSettings"]), + }; +} + +export function linuxPatchSettingsDeserializer(item: any): LinuxPatchSettings { + return { + patchMode: item["patchMode"], + assessmentMode: item["assessmentMode"], + automaticByPlatformSettings: !item["automaticByPlatformSettings"] + ? item["automaticByPlatformSettings"] + : linuxVMGuestPatchAutomaticByPlatformSettingsDeserializer( + item["automaticByPlatformSettings"], + ), + }; +} + +/** Specifies the mode of VM Guest Patching to IaaS virtual machine or virtual machines associated to virtual machine scale set with OrchestrationMode as Flexible.

Possible values are:

**ImageDefault** - The virtual machine's default patching configuration is used.

**AutomaticByPlatform** - The virtual machine will be automatically updated by the platform. The property provisionVMAgent must be true */ +export enum KnownLinuxVMGuestPatchMode { + /** ImageDefault linux VM guest patch mode */ + ImageDefault = "ImageDefault", + /** AutomaticByPlatform linux VM guest patch mode */ + AutomaticByPlatform = "AutomaticByPlatform", +} + +/** + * Specifies the mode of VM Guest Patching to IaaS virtual machine or virtual machines associated to virtual machine scale set with OrchestrationMode as Flexible.

Possible values are:

**ImageDefault** - The virtual machine's default patching configuration is used.

**AutomaticByPlatform** - The virtual machine will be automatically updated by the platform. The property provisionVMAgent must be true \ + * {@link KnownLinuxVMGuestPatchMode} can be used interchangeably with LinuxVMGuestPatchMode, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **ImageDefault**: ImageDefault linux VM guest patch mode \ + * **AutomaticByPlatform**: AutomaticByPlatform linux VM guest patch mode + */ +export type LinuxVMGuestPatchMode = string; + +/** Specifies the mode of VM Guest Patch Assessment for the IaaS virtual machine.

Possible values are:

**ImageDefault** - You control the timing of patch assessments on a virtual machine.

**AutomaticByPlatform** - The platform will trigger periodic patch assessments. The property provisionVMAgent must be true. */ +export enum KnownLinuxPatchAssessmentMode { + /** ImageDefault mode */ + ImageDefault = "ImageDefault", + /** AutomaticByPlatform mode */ + AutomaticByPlatform = "AutomaticByPlatform", +} + +/** + * Specifies the mode of VM Guest Patch Assessment for the IaaS virtual machine.

Possible values are:

**ImageDefault** - You control the timing of patch assessments on a virtual machine.

**AutomaticByPlatform** - The platform will trigger periodic patch assessments. The property provisionVMAgent must be true. \ + * {@link KnownLinuxPatchAssessmentMode} can be used interchangeably with LinuxPatchAssessmentMode, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **ImageDefault**: ImageDefault mode \ + * **AutomaticByPlatform**: AutomaticByPlatform mode + */ +export type LinuxPatchAssessmentMode = string; + +/** Specifies additional settings to be applied when patch mode AutomaticByPlatform is selected in Linux patch settings. */ +export interface LinuxVMGuestPatchAutomaticByPlatformSettings { + /** Specifies the reboot setting for all AutomaticByPlatform patch installation operations. */ + rebootSetting?: LinuxVMGuestPatchAutomaticByPlatformRebootSetting; + /** Enables customer to schedule patching without accidental upgrades */ + bypassPlatformSafetyChecksOnUserSchedule?: boolean; +} + +export function linuxVMGuestPatchAutomaticByPlatformSettingsSerializer( + item: LinuxVMGuestPatchAutomaticByPlatformSettings, +): any { + return { + rebootSetting: item["rebootSetting"], + bypassPlatformSafetyChecksOnUserSchedule: item["bypassPlatformSafetyChecksOnUserSchedule"], + }; +} + +export function linuxVMGuestPatchAutomaticByPlatformSettingsDeserializer( + item: any, +): LinuxVMGuestPatchAutomaticByPlatformSettings { + return { + rebootSetting: item["rebootSetting"], + bypassPlatformSafetyChecksOnUserSchedule: item["bypassPlatformSafetyChecksOnUserSchedule"], + }; +} + +/** Specifies the reboot setting for all AutomaticByPlatform patch installation operations. */ +export enum KnownLinuxVMGuestPatchAutomaticByPlatformRebootSetting { + /** Unknown reboot setting */ + Unknown = "Unknown", + /** Reboot if required */ + IfRequired = "IfRequired", + /** Never reboot */ + Never = "Never", + /** Always reboot */ + Always = "Always", +} + +/** + * Specifies the reboot setting for all AutomaticByPlatform patch installation operations. \ + * {@link KnownLinuxVMGuestPatchAutomaticByPlatformRebootSetting} can be used interchangeably with LinuxVMGuestPatchAutomaticByPlatformRebootSetting, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Unknown**: Unknown reboot setting \ + * **IfRequired**: Reboot if required \ + * **Never**: Never reboot \ + * **Always**: Always reboot + */ +export type LinuxVMGuestPatchAutomaticByPlatformRebootSetting = string; + +export function vaultSecretGroupArraySerializer(result: Array): any[] { + return result.map((item) => { + return vaultSecretGroupSerializer(item); + }); +} + +export function vaultSecretGroupArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return vaultSecretGroupDeserializer(item); + }); +} + +/** Describes a set of certificates which are all in the same Key Vault. */ +export interface VaultSecretGroup { + /** The relative URL of the Key Vault containing all of the certificates in VaultCertificates. */ + sourceVault?: SubResource; + /** The list of key vault references in SourceVault which contain certificates. */ + vaultCertificates?: VaultCertificate[]; +} + +export function vaultSecretGroupSerializer(item: VaultSecretGroup): any { + return { + sourceVault: !item["sourceVault"] + ? item["sourceVault"] + : subResourceSerializer(item["sourceVault"]), + vaultCertificates: !item["vaultCertificates"] + ? item["vaultCertificates"] + : vaultCertificateArraySerializer(item["vaultCertificates"]), + }; +} + +export function vaultSecretGroupDeserializer(item: any): VaultSecretGroup { + return { + sourceVault: !item["sourceVault"] + ? item["sourceVault"] + : subResourceDeserializer(item["sourceVault"]), + vaultCertificates: !item["vaultCertificates"] + ? item["vaultCertificates"] + : vaultCertificateArrayDeserializer(item["vaultCertificates"]), + }; +} + +export function vaultCertificateArraySerializer(result: Array): any[] { + return result.map((item) => { + return vaultCertificateSerializer(item); + }); +} + +export function vaultCertificateArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return vaultCertificateDeserializer(item); + }); +} + +/** Describes a single certificate reference in a Key Vault, and where the certificate should reside on the VM. */ +export interface VaultCertificate { + /** This is the URL of a certificate that has been uploaded to Key Vault as a secret. For adding a secret to the Key Vault, see [Add a key or secret to the key vault](https://docs.microsoft.com/azure/key-vault/key-vault-get-started/#add). In this case, your certificate needs to be It is the Base64 encoding of the following JSON Object which is encoded in UTF-8:

{
'data':'',
'dataType':'pfx',
'password':''
}
To install certificates on a virtual machine it is recommended to use the [Azure Key Vault virtual machine extension for Linux](https://docs.microsoft.com/azure/virtual-machines/extensions/key-vault-linux) or the [Azure Key Vault virtual machine extension for Windows](https://docs.microsoft.com/azure/virtual-machines/extensions/key-vault-windows). */ + certificateUrl?: string; + /** For Windows VMs, specifies the certificate store on the Virtual Machine to which the certificate should be added. The specified certificate store is implicitly in the LocalMachine account. For Linux VMs, the certificate file is placed under the /var/lib/waagent directory, with the file name .crt for the X509 certificate file and .prv for private key. Both of these files are .pem formatted. */ + certificateStore?: string; +} + +export function vaultCertificateSerializer(item: VaultCertificate): any { + return { certificateUrl: item["certificateUrl"], certificateStore: item["certificateStore"] }; +} + +export function vaultCertificateDeserializer(item: any): VaultCertificate { + return { + certificateUrl: item["certificateUrl"], + certificateStore: item["certificateStore"], + }; +} + +/** Specifies the network interfaces or the networking configuration of the virtual machine. */ +export interface NetworkProfile { + /** Specifies the list of resource Ids for the network interfaces associated with the virtual machine. */ + networkInterfaces?: NetworkInterfaceReference[]; + /** specifies the Microsoft.Network API version used when creating networking resources in the Network Interface Configurations */ + networkApiVersion?: NetworkApiVersion; + /** Specifies the networking configurations that will be used to create the virtual machine networking resources. */ + networkInterfaceConfigurations?: VirtualMachineNetworkInterfaceConfiguration[]; +} + +export function networkProfileSerializer(item: NetworkProfile): any { + return { + networkInterfaces: !item["networkInterfaces"] + ? item["networkInterfaces"] + : networkInterfaceReferenceArraySerializer(item["networkInterfaces"]), + networkApiVersion: item["networkApiVersion"], + networkInterfaceConfigurations: !item["networkInterfaceConfigurations"] + ? item["networkInterfaceConfigurations"] + : virtualMachineNetworkInterfaceConfigurationArraySerializer( + item["networkInterfaceConfigurations"], + ), + }; +} + +export function networkProfileDeserializer(item: any): NetworkProfile { + return { + networkInterfaces: !item["networkInterfaces"] + ? item["networkInterfaces"] + : networkInterfaceReferenceArrayDeserializer(item["networkInterfaces"]), + networkApiVersion: item["networkApiVersion"], + networkInterfaceConfigurations: !item["networkInterfaceConfigurations"] + ? item["networkInterfaceConfigurations"] + : virtualMachineNetworkInterfaceConfigurationArrayDeserializer( + item["networkInterfaceConfigurations"], + ), + }; +} + +export function networkInterfaceReferenceArraySerializer( + result: Array, +): any[] { + return result.map((item) => { + return networkInterfaceReferenceSerializer(item); + }); +} + +export function networkInterfaceReferenceArrayDeserializer( + result: Array, +): any[] { + return result.map((item) => { + return networkInterfaceReferenceDeserializer(item); + }); +} + +/** Describes a network interface reference. */ +export interface NetworkInterfaceReference extends SubResource { + /** Describes a network interface reference properties. */ + properties?: NetworkInterfaceReferenceProperties; +} + +export function networkInterfaceReferenceSerializer(item: NetworkInterfaceReference): any { + return { + id: item["id"], + properties: !item["properties"] + ? item["properties"] + : networkInterfaceReferencePropertiesSerializer(item["properties"]), + }; +} + +export function networkInterfaceReferenceDeserializer(item: any): NetworkInterfaceReference { + return { + id: item["id"], + properties: !item["properties"] + ? item["properties"] + : networkInterfaceReferencePropertiesDeserializer(item["properties"]), + }; +} + +/** Describes a network interface reference properties. */ +export interface NetworkInterfaceReferenceProperties { + /** Specifies the primary network interface in case the virtual machine has more than 1 network interface. */ + primary?: boolean; + /** Specify what happens to the network interface when the VM is deleted */ + deleteOption?: DeleteOptions; +} + +export function networkInterfaceReferencePropertiesSerializer( + item: NetworkInterfaceReferenceProperties, +): any { + return { primary: item["primary"], deleteOption: item["deleteOption"] }; +} + +export function networkInterfaceReferencePropertiesDeserializer( + item: any, +): NetworkInterfaceReferenceProperties { + return { + primary: item["primary"], + deleteOption: item["deleteOption"], + }; +} + +/** Specify what happens to the network interface when the VM is deleted */ +export enum KnownDeleteOptions { + /** Delete network interface when the VM is deleted */ + Delete = "Delete", + /** Detach network interface when the VM is deleted */ + Detach = "Detach", +} + +/** + * Specify what happens to the network interface when the VM is deleted \ + * {@link KnownDeleteOptions} can be used interchangeably with DeleteOptions, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Delete**: Delete network interface when the VM is deleted \ + * **Detach**: Detach network interface when the VM is deleted + */ +export type DeleteOptions = string; + +/** Specifies the Microsoft.Network API version used when creating networking resources in the Network Interface Configurations */ +export enum KnownNetworkApiVersion { + /** 2020-11-01 version */ + _20201101 = "2020-11-01", + /** 2022-11-01 version */ + _20221101 = "2022-11-01", +} + +/** + * Specifies the Microsoft.Network API version used when creating networking resources in the Network Interface Configurations \ + * {@link KnownNetworkApiVersion} can be used interchangeably with NetworkApiVersion, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **2020-11-01**: 2020-11-01 version \ + * **2022-11-01**: 2022-11-01 version + */ +export type NetworkApiVersion = string; + +export function virtualMachineNetworkInterfaceConfigurationArraySerializer( + result: Array, +): any[] { + return result.map((item) => { + return virtualMachineNetworkInterfaceConfigurationSerializer(item); + }); +} + +export function virtualMachineNetworkInterfaceConfigurationArrayDeserializer( + result: Array, +): any[] { + return result.map((item) => { + return virtualMachineNetworkInterfaceConfigurationDeserializer(item); + }); +} + +/** Describes a virtual machine network interface configurations. */ +export interface VirtualMachineNetworkInterfaceConfiguration { + /** The network interface configuration name. */ + name: string; + /** Describes a virtual machine network profile's IP configuration. */ + properties?: VirtualMachineNetworkInterfaceConfigurationProperties; + /** Resource tags applied to the networkInterface address created by this NetworkInterfaceConfiguration */ + tags?: Record; +} + +export function virtualMachineNetworkInterfaceConfigurationSerializer( + item: VirtualMachineNetworkInterfaceConfiguration, +): any { + return { + name: item["name"], + properties: !item["properties"] + ? item["properties"] + : virtualMachineNetworkInterfaceConfigurationPropertiesSerializer(item["properties"]), + tags: item["tags"], + }; +} + +export function virtualMachineNetworkInterfaceConfigurationDeserializer( + item: any, +): VirtualMachineNetworkInterfaceConfiguration { + return { + name: item["name"], + properties: !item["properties"] + ? item["properties"] + : virtualMachineNetworkInterfaceConfigurationPropertiesDeserializer(item["properties"]), + tags: !item["tags"] + ? item["tags"] + : Object.fromEntries(Object.entries(item["tags"]).map(([k, p]: [string, any]) => [k, p])), + }; +} + +/** Describes a virtual machine network profile's IP configuration. */ +export interface VirtualMachineNetworkInterfaceConfigurationProperties { + /** Specifies the primary network interface in case the virtual machine has more than 1 network interface. */ + primary?: boolean; + /** Specify what happens to the network interface when the VM is deleted */ + deleteOption?: DeleteOptions; + /** Specifies whether the network interface is accelerated networking-enabled. */ + enableAcceleratedNetworking?: boolean; + /** Specifies whether the network interface is disabled for tcp state tracking. */ + disableTcpStateTracking?: boolean; + /** Specifies whether the network interface is FPGA networking-enabled. */ + enableFpga?: boolean; + /** Whether IP forwarding enabled on this NIC. */ + enableIPForwarding?: boolean; + /** The network security group. */ + networkSecurityGroup?: SubResource; + /** The dns settings to be applied on the network interfaces. */ + dnsSettings?: VirtualMachineNetworkInterfaceDnsSettingsConfiguration; + /** Specifies the IP configurations of the network interface. */ + ipConfigurations: VirtualMachineNetworkInterfaceIPConfiguration[]; + /** The DSCP configuration for the network interface. */ + dscpConfiguration?: SubResource; + /** Specifies whether the Auxiliary mode is enabled for the Network Interface resource. */ + auxiliaryMode?: NetworkInterfaceAuxiliaryMode; + /** Specifies whether the Auxiliary sku is enabled for the Network Interface resource. */ + auxiliarySku?: NetworkInterfaceAuxiliarySku; +} + +export function virtualMachineNetworkInterfaceConfigurationPropertiesSerializer( + item: VirtualMachineNetworkInterfaceConfigurationProperties, +): any { + return { + primary: item["primary"], + deleteOption: item["deleteOption"], + enableAcceleratedNetworking: item["enableAcceleratedNetworking"], + disableTcpStateTracking: item["disableTcpStateTracking"], + enableFpga: item["enableFpga"], + enableIPForwarding: item["enableIPForwarding"], + networkSecurityGroup: !item["networkSecurityGroup"] + ? item["networkSecurityGroup"] + : subResourceSerializer(item["networkSecurityGroup"]), + dnsSettings: !item["dnsSettings"] + ? item["dnsSettings"] + : virtualMachineNetworkInterfaceDnsSettingsConfigurationSerializer(item["dnsSettings"]), + ipConfigurations: virtualMachineNetworkInterfaceIPConfigurationArraySerializer( + item["ipConfigurations"], + ), + dscpConfiguration: !item["dscpConfiguration"] + ? item["dscpConfiguration"] + : subResourceSerializer(item["dscpConfiguration"]), + auxiliaryMode: item["auxiliaryMode"], + auxiliarySku: item["auxiliarySku"], + }; +} + +export function virtualMachineNetworkInterfaceConfigurationPropertiesDeserializer( + item: any, +): VirtualMachineNetworkInterfaceConfigurationProperties { + return { + primary: item["primary"], + deleteOption: item["deleteOption"], + enableAcceleratedNetworking: item["enableAcceleratedNetworking"], + disableTcpStateTracking: item["disableTcpStateTracking"], + enableFpga: item["enableFpga"], + enableIPForwarding: item["enableIPForwarding"], + networkSecurityGroup: !item["networkSecurityGroup"] + ? item["networkSecurityGroup"] + : subResourceDeserializer(item["networkSecurityGroup"]), + dnsSettings: !item["dnsSettings"] + ? item["dnsSettings"] + : virtualMachineNetworkInterfaceDnsSettingsConfigurationDeserializer(item["dnsSettings"]), + ipConfigurations: virtualMachineNetworkInterfaceIPConfigurationArrayDeserializer( + item["ipConfigurations"], + ), + dscpConfiguration: !item["dscpConfiguration"] + ? item["dscpConfiguration"] + : subResourceDeserializer(item["dscpConfiguration"]), + auxiliaryMode: item["auxiliaryMode"], + auxiliarySku: item["auxiliarySku"], + }; +} + +/** Describes a virtual machines network configuration's DNS settings. */ +export interface VirtualMachineNetworkInterfaceDnsSettingsConfiguration { + /** List of DNS servers IP addresses */ + dnsServers?: string[]; +} + +export function virtualMachineNetworkInterfaceDnsSettingsConfigurationSerializer( + item: VirtualMachineNetworkInterfaceDnsSettingsConfiguration, +): any { + return { + dnsServers: !item["dnsServers"] + ? item["dnsServers"] + : item["dnsServers"].map((p: any) => { + return p; + }), + }; +} + +export function virtualMachineNetworkInterfaceDnsSettingsConfigurationDeserializer( + item: any, +): VirtualMachineNetworkInterfaceDnsSettingsConfiguration { + return { + dnsServers: !item["dnsServers"] + ? item["dnsServers"] + : item["dnsServers"].map((p: any) => { + return p; + }), + }; +} + +export function virtualMachineNetworkInterfaceIPConfigurationArraySerializer( + result: Array, +): any[] { + return result.map((item) => { + return virtualMachineNetworkInterfaceIPConfigurationSerializer(item); + }); +} + +export function virtualMachineNetworkInterfaceIPConfigurationArrayDeserializer( + result: Array, +): any[] { + return result.map((item) => { + return virtualMachineNetworkInterfaceIPConfigurationDeserializer(item); + }); +} + +/** Describes a virtual machine network profile's IP configuration. */ +export interface VirtualMachineNetworkInterfaceIPConfiguration { + /** The IP configuration name. */ + name: string; + /** Describes a virtual machine network interface IP configuration properties. */ + properties?: VirtualMachineNetworkInterfaceIPConfigurationProperties; +} + +export function virtualMachineNetworkInterfaceIPConfigurationSerializer( + item: VirtualMachineNetworkInterfaceIPConfiguration, +): any { + return { + name: item["name"], + properties: !item["properties"] + ? item["properties"] + : virtualMachineNetworkInterfaceIPConfigurationPropertiesSerializer(item["properties"]), + }; +} + +export function virtualMachineNetworkInterfaceIPConfigurationDeserializer( + item: any, +): VirtualMachineNetworkInterfaceIPConfiguration { + return { + name: item["name"], + properties: !item["properties"] + ? item["properties"] + : virtualMachineNetworkInterfaceIPConfigurationPropertiesDeserializer(item["properties"]), + }; +} + +/** Describes a virtual machine network interface IP configuration properties. */ +export interface VirtualMachineNetworkInterfaceIPConfigurationProperties { + /** Specifies the identifier of the subnet. */ + subnet?: SubResource; + /** Specifies the primary network interface in case the virtual machine has more than 1 network interface. */ + primary?: boolean; + /** The publicIPAddressConfiguration. */ + publicIPAddressConfiguration?: VirtualMachinePublicIPAddressConfiguration; + /** Available from Api-Version 2017-03-30 onwards, it represents whether the specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. Possible values are: 'IPv4' and 'IPv6'. */ + privateIPAddressVersion?: IPVersions; + /** Specifies an array of references to application security group. */ + applicationSecurityGroups?: SubResource[]; + /** Specifies an array of references to backend address pools of application gateways. A virtual machine can reference backend address pools of multiple application gateways. Multiple virtual machines cannot use the same application gateway. */ + applicationGatewayBackendAddressPools?: SubResource[]; + /** Specifies an array of references to backend address pools of load balancers. A virtual machine can reference backend address pools of one public and one internal load balancer. [Multiple virtual machines cannot use the same basic sku load balancer]. */ + loadBalancerBackendAddressPools?: SubResource[]; +} + +export function virtualMachineNetworkInterfaceIPConfigurationPropertiesSerializer( + item: VirtualMachineNetworkInterfaceIPConfigurationProperties, +): any { + return { + subnet: !item["subnet"] ? item["subnet"] : subResourceSerializer(item["subnet"]), + primary: item["primary"], + publicIPAddressConfiguration: !item["publicIPAddressConfiguration"] + ? item["publicIPAddressConfiguration"] + : virtualMachinePublicIPAddressConfigurationSerializer(item["publicIPAddressConfiguration"]), + privateIPAddressVersion: item["privateIPAddressVersion"], + applicationSecurityGroups: !item["applicationSecurityGroups"] + ? item["applicationSecurityGroups"] + : subResourceArraySerializer(item["applicationSecurityGroups"]), + applicationGatewayBackendAddressPools: !item["applicationGatewayBackendAddressPools"] + ? item["applicationGatewayBackendAddressPools"] + : subResourceArraySerializer(item["applicationGatewayBackendAddressPools"]), + loadBalancerBackendAddressPools: !item["loadBalancerBackendAddressPools"] + ? item["loadBalancerBackendAddressPools"] + : subResourceArraySerializer(item["loadBalancerBackendAddressPools"]), + }; +} + +export function virtualMachineNetworkInterfaceIPConfigurationPropertiesDeserializer( + item: any, +): VirtualMachineNetworkInterfaceIPConfigurationProperties { + return { + subnet: !item["subnet"] ? item["subnet"] : subResourceDeserializer(item["subnet"]), + primary: item["primary"], + publicIPAddressConfiguration: !item["publicIPAddressConfiguration"] + ? item["publicIPAddressConfiguration"] + : virtualMachinePublicIPAddressConfigurationDeserializer( + item["publicIPAddressConfiguration"], + ), + privateIPAddressVersion: item["privateIPAddressVersion"], + applicationSecurityGroups: !item["applicationSecurityGroups"] + ? item["applicationSecurityGroups"] + : subResourceArrayDeserializer(item["applicationSecurityGroups"]), + applicationGatewayBackendAddressPools: !item["applicationGatewayBackendAddressPools"] + ? item["applicationGatewayBackendAddressPools"] + : subResourceArrayDeserializer(item["applicationGatewayBackendAddressPools"]), + loadBalancerBackendAddressPools: !item["loadBalancerBackendAddressPools"] + ? item["loadBalancerBackendAddressPools"] + : subResourceArrayDeserializer(item["loadBalancerBackendAddressPools"]), + }; +} + +/** Describes a virtual machines IP Configuration's PublicIPAddress configuration */ +export interface VirtualMachinePublicIPAddressConfiguration { + /** The publicIP address configuration name. */ + name: string; + /** Describes a virtual machines IP Configuration's PublicIPAddress configuration */ + properties?: VirtualMachinePublicIPAddressConfigurationProperties; + /** Describes the public IP Sku. It can only be set with OrchestrationMode as Flexible. */ + sku?: PublicIPAddressSku; + /** Resource tags applied to the publicIP address created by this PublicIPAddressConfiguration */ + tags?: Record; +} + +export function virtualMachinePublicIPAddressConfigurationSerializer( + item: VirtualMachinePublicIPAddressConfiguration, +): any { + return { + name: item["name"], + properties: !item["properties"] + ? item["properties"] + : virtualMachinePublicIPAddressConfigurationPropertiesSerializer(item["properties"]), + sku: !item["sku"] ? item["sku"] : publicIPAddressSkuSerializer(item["sku"]), + tags: item["tags"], + }; +} + +export function virtualMachinePublicIPAddressConfigurationDeserializer( + item: any, +): VirtualMachinePublicIPAddressConfiguration { + return { + name: item["name"], + properties: !item["properties"] + ? item["properties"] + : virtualMachinePublicIPAddressConfigurationPropertiesDeserializer(item["properties"]), + sku: !item["sku"] ? item["sku"] : publicIPAddressSkuDeserializer(item["sku"]), + tags: !item["tags"] + ? item["tags"] + : Object.fromEntries(Object.entries(item["tags"]).map(([k, p]: [string, any]) => [k, p])), + }; +} + +/** Describes a virtual machines IP Configuration's PublicIPAddress configuration */ +export interface VirtualMachinePublicIPAddressConfigurationProperties { + /** The idle timeout of the public IP address. */ + idleTimeoutInMinutes?: number; + /** Specify what happens to the public IP address when the VM is deleted */ + deleteOption?: DeleteOptions; + /** The dns settings to be applied on the publicIP addresses . */ + dnsSettings?: VirtualMachinePublicIPAddressDnsSettingsConfiguration; + /** The list of IP tags associated with the public IP address. */ + ipTags?: VirtualMachineIpTag[]; + /** The PublicIPPrefix from which to allocate publicIP addresses. */ + publicIPPrefix?: SubResource; + /** Available from Api-Version 2019-07-01 onwards, it represents whether the specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. Possible values are: 'IPv4' and 'IPv6'. */ + publicIPAddressVersion?: IPVersions; + /** Specify the public IP allocation type */ + publicIPAllocationMethod?: PublicIPAllocationMethod; +} + +export function virtualMachinePublicIPAddressConfigurationPropertiesSerializer( + item: VirtualMachinePublicIPAddressConfigurationProperties, +): any { + return { + idleTimeoutInMinutes: item["idleTimeoutInMinutes"], + deleteOption: item["deleteOption"], + dnsSettings: !item["dnsSettings"] + ? item["dnsSettings"] + : virtualMachinePublicIPAddressDnsSettingsConfigurationSerializer(item["dnsSettings"]), + ipTags: !item["ipTags"] ? item["ipTags"] : virtualMachineIpTagArraySerializer(item["ipTags"]), + publicIPPrefix: !item["publicIPPrefix"] + ? item["publicIPPrefix"] + : subResourceSerializer(item["publicIPPrefix"]), + publicIPAddressVersion: item["publicIPAddressVersion"], + publicIPAllocationMethod: item["publicIPAllocationMethod"], + }; +} + +export function virtualMachinePublicIPAddressConfigurationPropertiesDeserializer( + item: any, +): VirtualMachinePublicIPAddressConfigurationProperties { + return { + idleTimeoutInMinutes: item["idleTimeoutInMinutes"], + deleteOption: item["deleteOption"], + dnsSettings: !item["dnsSettings"] + ? item["dnsSettings"] + : virtualMachinePublicIPAddressDnsSettingsConfigurationDeserializer(item["dnsSettings"]), + ipTags: !item["ipTags"] ? item["ipTags"] : virtualMachineIpTagArrayDeserializer(item["ipTags"]), + publicIPPrefix: !item["publicIPPrefix"] + ? item["publicIPPrefix"] + : subResourceDeserializer(item["publicIPPrefix"]), + publicIPAddressVersion: item["publicIPAddressVersion"], + publicIPAllocationMethod: item["publicIPAllocationMethod"], + }; +} + +/** Describes a virtual machines network configuration's DNS settings. */ +export interface VirtualMachinePublicIPAddressDnsSettingsConfiguration { + /** The Domain name label prefix of the PublicIPAddress resources that will be created. The generated name label is the concatenation of the domain name label and vm network profile unique ID. */ + domainNameLabel: string; + /** The Domain name label scope of the PublicIPAddress resources that will be created. The generated name label is the concatenation of the hashed domain name label with policy according to the domain name label scope and vm network profile unique ID. */ + domainNameLabelScope?: DomainNameLabelScopeTypes; +} + +export function virtualMachinePublicIPAddressDnsSettingsConfigurationSerializer( + item: VirtualMachinePublicIPAddressDnsSettingsConfiguration, +): any { + return { + domainNameLabel: item["domainNameLabel"], + domainNameLabelScope: item["domainNameLabelScope"], + }; +} + +export function virtualMachinePublicIPAddressDnsSettingsConfigurationDeserializer( + item: any, +): VirtualMachinePublicIPAddressDnsSettingsConfiguration { + return { + domainNameLabel: item["domainNameLabel"], + domainNameLabelScope: item["domainNameLabelScope"], + }; +} + +/** The Domain name label scope.The concatenation of the hashed domain name label that generated according to the policy from domain name label scope and vm index will be the domain name labels of the PublicIPAddress resources that will be created */ +export enum KnownDomainNameLabelScopeTypes { + /** TenantReuse scope type */ + TenantReuse = "TenantReuse", + /** SubscriptionReuse scope type */ + SubscriptionReuse = "SubscriptionReuse", + /** ResourceGroupReuse scope type */ + ResourceGroupReuse = "ResourceGroupReuse", + /** NoReuse scope type */ + NoReuse = "NoReuse", +} + +/** + * The Domain name label scope.The concatenation of the hashed domain name label that generated according to the policy from domain name label scope and vm index will be the domain name labels of the PublicIPAddress resources that will be created \ + * {@link KnownDomainNameLabelScopeTypes} can be used interchangeably with DomainNameLabelScopeTypes, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **TenantReuse**: TenantReuse scope type \ + * **SubscriptionReuse**: SubscriptionReuse scope type \ + * **ResourceGroupReuse**: ResourceGroupReuse scope type \ + * **NoReuse**: NoReuse scope type + */ +export type DomainNameLabelScopeTypes = string; + +export function virtualMachineIpTagArraySerializer(result: Array): any[] { + return result.map((item) => { + return virtualMachineIpTagSerializer(item); + }); +} + +export function virtualMachineIpTagArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return virtualMachineIpTagDeserializer(item); + }); +} + +/** Contains the IP tag associated with the public IP address. */ +export interface VirtualMachineIpTag { + /** IP tag type. Example: FirstPartyUsage. */ + ipTagType?: string; + /** IP tag associated with the public IP. Example: SQL, Storage etc. */ + tag?: string; +} + +export function virtualMachineIpTagSerializer(item: VirtualMachineIpTag): any { + return { ipTagType: item["ipTagType"], tag: item["tag"] }; +} + +export function virtualMachineIpTagDeserializer(item: any): VirtualMachineIpTag { + return { + ipTagType: item["ipTagType"], + tag: item["tag"], + }; +} + +/** Available from compute Api-Version 2017-03-30 onwards, it represents whether the specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. Possible values are: 'IPv4' and 'IPv6'. */ +export enum KnownIPVersions { + /** IPv4 version */ + IPv4 = "IPv4", + /** IPv6 version */ + IPv6 = "IPv6", +} + +/** + * Available from compute Api-Version 2017-03-30 onwards, it represents whether the specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. Possible values are: 'IPv4' and 'IPv6'. \ + * {@link KnownIPVersions} can be used interchangeably with IPVersions, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **IPv4**: IPv4 version \ + * **IPv6**: IPv6 version + */ +export type IPVersions = string; + +/** Specify the public IP allocation type */ +export enum KnownPublicIPAllocationMethod { + /** Dynamic IP allocation */ + Dynamic = "Dynamic", + /** Static IP allocation */ + Static = "Static", +} + +/** + * Specify the public IP allocation type \ + * {@link KnownPublicIPAllocationMethod} can be used interchangeably with PublicIPAllocationMethod, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Dynamic**: Dynamic IP allocation \ + * **Static**: Static IP allocation + */ +export type PublicIPAllocationMethod = string; + +/** Describes the public IP Sku. It can only be set with OrchestrationMode as Flexible. */ +export interface PublicIPAddressSku { + /** Specify public IP sku name */ + name?: PublicIPAddressSkuName; + /** Specify public IP sku tier */ + tier?: PublicIPAddressSkuTier; +} + +export function publicIPAddressSkuSerializer(item: PublicIPAddressSku): any { + return { name: item["name"], tier: item["tier"] }; +} + +export function publicIPAddressSkuDeserializer(item: any): PublicIPAddressSku { + return { + name: item["name"], + tier: item["tier"], + }; +} + +/** Specify public IP sku name */ +export enum KnownPublicIPAddressSkuName { + /** Basic IP sku name */ + Basic = "Basic", + /** Standard IP sku name */ + Standard = "Standard", +} + +/** + * Specify public IP sku name \ + * {@link KnownPublicIPAddressSkuName} can be used interchangeably with PublicIPAddressSkuName, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Basic**: Basic IP sku name \ + * **Standard**: Standard IP sku name + */ +export type PublicIPAddressSkuName = string; + +/** Specify public IP sku tier */ +export enum KnownPublicIPAddressSkuTier { + /** Regional IP address sku tier */ + Regional = "Regional", + /** Global IP address sku tier */ + Global = "Global", +} + +/** + * Specify public IP sku tier \ + * {@link KnownPublicIPAddressSkuTier} can be used interchangeably with PublicIPAddressSkuTier, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Regional**: Regional IP address sku tier \ + * **Global**: Global IP address sku tier + */ +export type PublicIPAddressSkuTier = string; + +export function subResourceArraySerializer(result: Array): any[] { + return result.map((item) => { + return subResourceSerializer(item); + }); +} + +export function subResourceArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return subResourceDeserializer(item); + }); +} + +/** Specifies whether the Auxiliary mode is enabled for the Network Interface resource. */ +export enum KnownNetworkInterfaceAuxiliaryMode { + /** None mode */ + None = "None", + /** AcceleratedConnections mode */ + AcceleratedConnections = "AcceleratedConnections", + /** Floating mode */ + Floating = "Floating", +} + +/** + * Specifies whether the Auxiliary mode is enabled for the Network Interface resource. \ + * {@link KnownNetworkInterfaceAuxiliaryMode} can be used interchangeably with NetworkInterfaceAuxiliaryMode, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **None**: None mode \ + * **AcceleratedConnections**: AcceleratedConnections mode \ + * **Floating**: Floating mode + */ +export type NetworkInterfaceAuxiliaryMode = string; + +/** Specifies whether the Auxiliary sku is enabled for the Network Interface resource. */ +export enum KnownNetworkInterfaceAuxiliarySku { + /** None: None sku */ + None = "None", + /** A1 sku */ + A1 = "A1", + /** A2 sku */ + A2 = "A2", + /** A4 sku */ + A4 = "A4", + /** A8 sku */ + A8 = "A8", +} + +/** + * Specifies whether the Auxiliary sku is enabled for the Network Interface resource. \ + * {@link KnownNetworkInterfaceAuxiliarySku} can be used interchangeably with NetworkInterfaceAuxiliarySku, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **None**: None: None sku \ + * **A1**: A1 sku \ + * **A2**: A2 sku \ + * **A4**: A4 sku \ + * **A8**: A8 sku + */ +export type NetworkInterfaceAuxiliarySku = string; + +/** Specifies the Security profile settings for the virtual machine or virtual machine scale set. */ +export interface SecurityProfile { + /** Specifies the security settings like secure boot and vTPM used while creating the virtual machine. Minimum compute api-version: 2020-12-01. */ + uefiSettings?: UefiSettings; + /** This property can be used by user in the request to enable or disable the Host Encryption for the virtual machine or virtual machine scale set. This will enable the encryption for all the disks including Resource/Temp disk at host itself. The default behavior is: The Encryption at host will be disabled unless this property is set to true for the resource. */ + encryptionAtHost?: boolean; + /** Specifies the SecurityType of the virtual machine. It has to be set to any specified value to enable UefiSettings. The default behavior is: UefiSettings will not be enabled unless this property is set. */ + securityType?: SecurityTypes; + /** Specifies the Managed Identity used by ADE to get access token for keyvault operations. */ + encryptionIdentity?: EncryptionIdentity; + /** Specifies ProxyAgent settings while creating the virtual machine. Minimum compute api-version: 2023-09-01. */ + proxyAgentSettings?: ProxyAgentSettings; +} + +export function securityProfileSerializer(item: SecurityProfile): any { + return { + uefiSettings: !item["uefiSettings"] + ? item["uefiSettings"] + : uefiSettingsSerializer(item["uefiSettings"]), + encryptionAtHost: item["encryptionAtHost"], + securityType: item["securityType"], + encryptionIdentity: !item["encryptionIdentity"] + ? item["encryptionIdentity"] + : encryptionIdentitySerializer(item["encryptionIdentity"]), + proxyAgentSettings: !item["proxyAgentSettings"] + ? item["proxyAgentSettings"] + : proxyAgentSettingsSerializer(item["proxyAgentSettings"]), + }; +} + +export function securityProfileDeserializer(item: any): SecurityProfile { + return { + uefiSettings: !item["uefiSettings"] + ? item["uefiSettings"] + : uefiSettingsDeserializer(item["uefiSettings"]), + encryptionAtHost: item["encryptionAtHost"], + securityType: item["securityType"], + encryptionIdentity: !item["encryptionIdentity"] + ? item["encryptionIdentity"] + : encryptionIdentityDeserializer(item["encryptionIdentity"]), + proxyAgentSettings: !item["proxyAgentSettings"] + ? item["proxyAgentSettings"] + : proxyAgentSettingsDeserializer(item["proxyAgentSettings"]), + }; +} + +/** Specifies the security settings like secure boot and vTPM used while creating the virtual machine. Minimum api-version: 2020-12-01. */ +export interface UefiSettings { + /** Specifies whether secure boot should be enabled on the virtual machine. Minimum compute api-version: 2020-12-01. */ + secureBootEnabled?: boolean; + /** Specifies whether vTPM should be enabled on the virtual machine. Minimum compute api-version: 2020-12-01. */ + vTpmEnabled?: boolean; +} + +export function uefiSettingsSerializer(item: UefiSettings): any { + return { secureBootEnabled: item["secureBootEnabled"], vTpmEnabled: item["vTpmEnabled"] }; +} + +export function uefiSettingsDeserializer(item: any): UefiSettings { + return { + secureBootEnabled: item["secureBootEnabled"], + vTpmEnabled: item["vTpmEnabled"], + }; +} + +/** Specifies the SecurityType of the virtual machine. It has to be set to any specified value to enable UefiSettings. The default behavior is: UefiSettings will not be enabled unless this property is set. */ +export enum KnownSecurityTypes { + /** TrustedLaunch security type */ + TrustedLaunch = "TrustedLaunch", + /** ConfidentialVM security type */ + ConfidentialVM = "ConfidentialVM", +} + +/** + * Specifies the SecurityType of the virtual machine. It has to be set to any specified value to enable UefiSettings. The default behavior is: UefiSettings will not be enabled unless this property is set. \ + * {@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**: TrustedLaunch security type \ + * **ConfidentialVM**: ConfidentialVM security type + */ +export type SecurityTypes = string; + +/** Specifies the Managed Identity used by ADE to get access token for keyvault operations. */ +export interface EncryptionIdentity { + /** Specifies ARM Resource ID of one of the user identities associated with the VM. */ + userAssignedIdentityResourceId?: string; +} + +export function encryptionIdentitySerializer(item: EncryptionIdentity): any { + return { userAssignedIdentityResourceId: item["userAssignedIdentityResourceId"] }; +} + +export function encryptionIdentityDeserializer(item: any): EncryptionIdentity { + return { + userAssignedIdentityResourceId: item["userAssignedIdentityResourceId"], + }; +} + +/** Specifies ProxyAgent settings for the virtual machine or virtual machine scale set. Minimum api-version: 2023-09-01. */ +export interface ProxyAgentSettings { + /** Specifies whether ProxyAgent feature should be enabled on the virtual machine or virtual machine scale set. */ + enabled?: boolean; + /** Specifies the mode that ProxyAgent will execute on. Warning: this property has been deprecated, please specify 'mode' under particular hostendpoint setting. */ + mode?: Mode; + /** Increase the value of this property allows users to reset the key used for securing communication channel between guest and host. */ + keyIncarnationId?: number; + /** Specifies the Wire Server endpoint settings while creating the virtual machine or virtual machine scale set. Minimum api-version: 2024-03-01. */ + wireServer?: HostEndpointSettings; + /** Specifies the IMDS endpoint settings while creating the virtual machine or virtual machine scale set. Minimum api-version: 2024-03-01. */ + imds?: HostEndpointSettings; + /** Specify whether to implicitly install the ProxyAgent Extension. This option is currently applicable only for Linux Os. */ + addProxyAgentExtension?: boolean; +} + +export function proxyAgentSettingsSerializer(item: ProxyAgentSettings): any { + return { + enabled: item["enabled"], + mode: item["mode"], + keyIncarnationId: item["keyIncarnationId"], + wireServer: !item["wireServer"] + ? item["wireServer"] + : hostEndpointSettingsSerializer(item["wireServer"]), + imds: !item["imds"] ? item["imds"] : hostEndpointSettingsSerializer(item["imds"]), + addProxyAgentExtension: item["addProxyAgentExtension"], + }; +} + +export function proxyAgentSettingsDeserializer(item: any): ProxyAgentSettings { + return { + enabled: item["enabled"], + mode: item["mode"], + keyIncarnationId: item["keyIncarnationId"], + wireServer: !item["wireServer"] + ? item["wireServer"] + : hostEndpointSettingsDeserializer(item["wireServer"]), + imds: !item["imds"] ? item["imds"] : hostEndpointSettingsDeserializer(item["imds"]), + addProxyAgentExtension: item["addProxyAgentExtension"], + }; +} + +/** Specifies the mode that ProxyAgent will execute on if the feature is enabled. ProxyAgent will start to audit or monitor but not enforce access control over requests to host endpoints in Audit mode, while in Enforce mode it will enforce access control. The default value is Enforce mode. */ +export enum KnownMode { + /** Audit mode */ + Audit = "Audit", + /** Enforce mode */ + Enforce = "Enforce", +} + +/** + * Specifies the mode that ProxyAgent will execute on if the feature is enabled. ProxyAgent will start to audit or monitor but not enforce access control over requests to host endpoints in Audit mode, while in Enforce mode it will enforce access control. The default value is Enforce mode. \ + * {@link KnownMode} can be used interchangeably with Mode, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Audit**: Audit mode \ + * **Enforce**: Enforce mode + */ +export type Mode = string; + +/** Specifies particular host endpoint settings. */ +export interface HostEndpointSettings { + /** Specifies the execution mode. In Audit mode, the system acts as if it is enforcing the access control policy, including emitting access denial entries in the logs but it does not actually deny any requests to host endpoints. In Enforce mode, the system will enforce the access control and it is the recommended mode of operation. */ + mode?: Modes; + /** Specifies the InVMAccessControlProfileVersion resource id in the format of /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/inVMAccessControlProfiles/{profile}/versions/{version} */ + inVMAccessControlProfileReferenceId?: string; +} + +export function hostEndpointSettingsSerializer(item: HostEndpointSettings): any { + return { + mode: item["mode"], + inVMAccessControlProfileReferenceId: item["inVMAccessControlProfileReferenceId"], + }; +} + +export function hostEndpointSettingsDeserializer(item: any): HostEndpointSettings { + return { + mode: item["mode"], + inVMAccessControlProfileReferenceId: item["inVMAccessControlProfileReferenceId"], + }; +} + +/** Specifies the execution mode. In Audit mode, the system acts as if it is enforcing the access control policy, including emitting access denial entries in the logs but it does not actually deny any requests to host endpoints. In Enforce mode, the system will enforce the access control and it is the recommended mode of operation. */ +export enum KnownModes { + /** Audit mode */ + Audit = "Audit", + /** Enforce mode */ + Enforce = "Enforce", + /** Disabled mode */ + Disabled = "Disabled", +} + +/** + * Specifies the execution mode. In Audit mode, the system acts as if it is enforcing the access control policy, including emitting access denial entries in the logs but it does not actually deny any requests to host endpoints. In Enforce mode, the system will enforce the access control and it is the recommended mode of operation. \ + * {@link KnownModes} can be used interchangeably with Modes, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Audit**: Audit mode \ + * **Enforce**: Enforce mode \ + * **Disabled**: Disabled mode + */ +export type Modes = string; + +/** Specifies the boot diagnostic settings state. Minimum compute api-version: 2015-06-15. */ +export interface DiagnosticsProfile { + /** Boot Diagnostics is a debugging feature which allows you to view Console Output and Screenshot to diagnose VM status. **NOTE**: If storageUri is being specified then ensure that the storage account is in the same region and subscription as the VM. You can easily view the output of your console log. Azure also enables you to see a screenshot of the VM from the hypervisor. */ + bootDiagnostics?: BootDiagnostics; +} + +export function diagnosticsProfileSerializer(item: DiagnosticsProfile): any { + return { + bootDiagnostics: !item["bootDiagnostics"] + ? item["bootDiagnostics"] + : bootDiagnosticsSerializer(item["bootDiagnostics"]), + }; +} + +export function diagnosticsProfileDeserializer(item: any): DiagnosticsProfile { + return { + bootDiagnostics: !item["bootDiagnostics"] + ? item["bootDiagnostics"] + : bootDiagnosticsDeserializer(item["bootDiagnostics"]), + }; +} + +/** Boot Diagnostics is a debugging feature which allows you to view Console Output and Screenshot to diagnose VM status. You can easily view the output of your console log. Azure also enables you to see a screenshot of the VM from the hypervisor. */ +export interface BootDiagnostics { + /** Whether boot diagnostics should be enabled on the Virtual Machine. */ + enabled?: boolean; + /** Uri of the storage account to use for placing the console output and screenshot. If storageUri is not specified while enabling boot diagnostics, managed storage will be used. */ + storageUri?: string; +} + +export function bootDiagnosticsSerializer(item: BootDiagnostics): any { + return { enabled: item["enabled"], storageUri: item["storageUri"] }; +} + +export function bootDiagnosticsDeserializer(item: any): BootDiagnostics { + return { + enabled: item["enabled"], + storageUri: item["storageUri"], + }; +} + +/** Profile for the scheduled events. */ +export interface ScheduledEventsProfile { + /** Specifies Terminate Scheduled Event related configurations. */ + terminateNotificationProfile?: TerminateNotificationProfile; + /** Specifies OS Image Scheduled Event related configurations. */ + osImageNotificationProfile?: OSImageNotificationProfile; +} + +export function scheduledEventsProfileSerializer(item: ScheduledEventsProfile): any { + return { + terminateNotificationProfile: !item["terminateNotificationProfile"] + ? item["terminateNotificationProfile"] + : terminateNotificationProfileSerializer(item["terminateNotificationProfile"]), + osImageNotificationProfile: !item["osImageNotificationProfile"] + ? item["osImageNotificationProfile"] + : osImageNotificationProfileSerializer(item["osImageNotificationProfile"]), + }; +} + +export function scheduledEventsProfileDeserializer(item: any): ScheduledEventsProfile { + return { + terminateNotificationProfile: !item["terminateNotificationProfile"] + ? item["terminateNotificationProfile"] + : terminateNotificationProfileDeserializer(item["terminateNotificationProfile"]), + osImageNotificationProfile: !item["osImageNotificationProfile"] + ? item["osImageNotificationProfile"] + : osImageNotificationProfileDeserializer(item["osImageNotificationProfile"]), + }; +} + +/** Profile properties for the Terminate Scheduled event. */ +export interface TerminateNotificationProfile { + /** Configurable length of time a Virtual Machine being deleted will have to potentially approve the Terminate Scheduled Event before the event is auto approved (timed out). The configuration must be specified in ISO 8601 format, the default value is 5 minutes (PT5M) */ + notBeforeTimeout?: string; + /** Specifies whether the Terminate Scheduled event is enabled or disabled. */ + enable?: boolean; +} + +export function terminateNotificationProfileSerializer(item: TerminateNotificationProfile): any { + return { notBeforeTimeout: item["notBeforeTimeout"], enable: item["enable"] }; +} + +export function terminateNotificationProfileDeserializer(item: any): TerminateNotificationProfile { + return { + notBeforeTimeout: item["notBeforeTimeout"], + enable: item["enable"], + }; +} + +/** Profile for the OS Image Scheduled event. */ +export interface OSImageNotificationProfile { + /** Length of time a Virtual Machine being reimaged or having its OS upgraded will have to potentially approve the OS Image Scheduled Event before the event is auto approved (timed out). The configuration is specified in ISO 8601 format, and the value must be 15 minutes (PT15M) */ + notBeforeTimeout?: string; + /** Specifies whether the OS Image Scheduled event is enabled or disabled. */ + enable?: boolean; +} + +export function osImageNotificationProfileSerializer(item: OSImageNotificationProfile): any { + return { notBeforeTimeout: item["notBeforeTimeout"], enable: item["enable"] }; +} + +export function osImageNotificationProfileDeserializer(item: any): OSImageNotificationProfile { + return { + notBeforeTimeout: item["notBeforeTimeout"], + enable: item["enable"], + }; +} + +/** The parameters of a capacity reservation Profile. */ +export interface CapacityReservationProfile { + /** Specifies the capacity reservation group resource id that should be used for allocating the virtual machine provided enough capacity has been reserved. Please refer to https://aka.ms/CapacityReservation for more details. */ + capacityReservationGroup?: SubResource; +} + +export function capacityReservationProfileSerializer(item: CapacityReservationProfile): any { + return { + capacityReservationGroup: !item["capacityReservationGroup"] + ? item["capacityReservationGroup"] + : subResourceSerializer(item["capacityReservationGroup"]), + }; +} + +export function capacityReservationProfileDeserializer(item: any): CapacityReservationProfile { + return { + capacityReservationGroup: !item["capacityReservationGroup"] + ? item["capacityReservationGroup"] + : subResourceDeserializer(item["capacityReservationGroup"]), + }; +} + +/** Contains the list of gallery applications that should be made available to the VM */ +export interface ApplicationProfile { + /** Specifies the gallery applications that should be made available to the VM */ + galleryApplications?: VMGalleryApplication[]; +} + +export function applicationProfileSerializer(item: ApplicationProfile): any { + return { + galleryApplications: !item["galleryApplications"] + ? item["galleryApplications"] + : vmGalleryApplicationArraySerializer(item["galleryApplications"]), + }; +} + +export function applicationProfileDeserializer(item: any): ApplicationProfile { + return { + galleryApplications: !item["galleryApplications"] + ? item["galleryApplications"] + : vmGalleryApplicationArrayDeserializer(item["galleryApplications"]), + }; +} + +export function vmGalleryApplicationArraySerializer(result: Array): any[] { + return result.map((item) => { + return vmGalleryApplicationSerializer(item); + }); +} + +export function vmGalleryApplicationArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return vmGalleryApplicationDeserializer(item); + }); +} + +/** Specifies the required information to reference a compute gallery application version */ +export interface VMGalleryApplication { + /** Optional, Specifies a passthrough value for more generic context. */ + tags?: string; + /** Optional, Specifies the order in which the packages have to be installed */ + order?: number; + /** Specifies the GalleryApplicationVersion resource id on the form of /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{application}/versions/{version} */ + packageReferenceId: string; + /** Optional, Specifies the uri to an azure blob that will replace the default configuration for the package if provided */ + configurationReference?: string; + /** Optional, If true, any failure for any operation in the VmApplication will fail the deployment */ + treatFailureAsDeploymentFailure?: boolean; + /** If set to true, when a new Gallery Application version is available in PIR/SIG, it will be automatically updated for the VM/VMSS */ + enableAutomaticUpgrade?: boolean; +} + +export function vmGalleryApplicationSerializer(item: VMGalleryApplication): any { + return { + tags: item["tags"], + order: item["order"], + packageReferenceId: item["packageReferenceId"], + configurationReference: item["configurationReference"], + treatFailureAsDeploymentFailure: item["treatFailureAsDeploymentFailure"], + enableAutomaticUpgrade: item["enableAutomaticUpgrade"], + }; +} + +export function vmGalleryApplicationDeserializer(item: any): VMGalleryApplication { + return { + tags: item["tags"], + order: item["order"], + packageReferenceId: item["packageReferenceId"], + configurationReference: item["configurationReference"], + treatFailureAsDeploymentFailure: item["treatFailureAsDeploymentFailure"], + enableAutomaticUpgrade: item["enableAutomaticUpgrade"], + }; +} + +export function virtualMachineExtensionArraySerializer( + result: Array, +): any[] { + return result.map((item) => { + return virtualMachineExtensionSerializer(item); + }); +} + +export function virtualMachineExtensionArrayDeserializer( + result: Array, +): any[] { + return result.map((item) => { + return virtualMachineExtensionDeserializer(item); + }); +} + +/** Defines a virtual machine extension. */ +export interface VirtualMachineExtension { + /** The name of the virtual machine extension. */ + name: string; + /** Properties of the virtual machine extension. */ + properties: VirtualMachineExtensionProperties; +} + +export function virtualMachineExtensionSerializer(item: VirtualMachineExtension): any { + return { + name: item["name"], + properties: virtualMachineExtensionPropertiesSerializer(item["properties"]), + }; +} + +export function virtualMachineExtensionDeserializer(item: any): VirtualMachineExtension { + return { + name: item["name"], + properties: virtualMachineExtensionPropertiesDeserializer(item["properties"]), + }; +} + +/** Describes the properties of a Virtual Machine Extension. */ +export interface VirtualMachineExtensionProperties { + /** How the extension handler should be forced to update even if the extension configuration has not changed. */ + forceUpdateTag?: string; + /** The name of the extension handler publisher. */ + publisher?: string; + /** Specifies the type of the extension; an example is 'CustomScriptExtension'. */ + type?: string; + /** Specifies the version of the script handler. */ + typeHandlerVersion?: string; + /** Indicates whether the extension should use a newer minor version if one is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless redeployed, even with this property set to true. */ + autoUpgradeMinorVersion?: boolean; + /** Indicates whether the extension should be automatically upgraded by the platform if there is a newer version of the extension available. */ + enableAutomaticUpgrade?: boolean; + /** JSON formatted public settings for the extension. */ + settings?: Record; + /** The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. */ + protectedSettings?: Record; + /** Indicates whether failures stemming from the extension will be suppressed (Operational failures such as not connecting to the VM will not be suppressed regardless of this value). The default is false. */ + suppressFailures?: boolean; + /** The extensions protected settings that are passed by reference, and consumed from key vault */ + protectedSettingsFromKeyVault?: KeyVaultSecretReference; + /** Collection of extension names after which this extension needs to be provisioned. */ + provisionAfterExtensions?: string[]; +} + +export function virtualMachineExtensionPropertiesSerializer( + item: VirtualMachineExtensionProperties, +): any { + return { + forceUpdateTag: item["forceUpdateTag"], + publisher: item["publisher"], + type: item["type"], + typeHandlerVersion: item["typeHandlerVersion"], + autoUpgradeMinorVersion: item["autoUpgradeMinorVersion"], + enableAutomaticUpgrade: item["enableAutomaticUpgrade"], + settings: item["settings"], + protectedSettings: item["protectedSettings"], + suppressFailures: item["suppressFailures"], + protectedSettingsFromKeyVault: !item["protectedSettingsFromKeyVault"] + ? item["protectedSettingsFromKeyVault"] + : keyVaultSecretReferenceSerializer(item["protectedSettingsFromKeyVault"]), + provisionAfterExtensions: !item["provisionAfterExtensions"] + ? item["provisionAfterExtensions"] + : item["provisionAfterExtensions"].map((p: any) => { + return p; + }), + }; +} + +export function virtualMachineExtensionPropertiesDeserializer( + item: any, +): VirtualMachineExtensionProperties { + return { + forceUpdateTag: item["forceUpdateTag"], + publisher: item["publisher"], + type: item["type"], + typeHandlerVersion: item["typeHandlerVersion"], + autoUpgradeMinorVersion: item["autoUpgradeMinorVersion"], + enableAutomaticUpgrade: item["enableAutomaticUpgrade"], + settings: !item["settings"] + ? item["settings"] + : Object.fromEntries(Object.entries(item["settings"]).map(([k, p]: [string, any]) => [k, p])), + protectedSettings: !item["protectedSettings"] + ? item["protectedSettings"] + : Object.fromEntries( + Object.entries(item["protectedSettings"]).map(([k, p]: [string, any]) => [k, p]), + ), + suppressFailures: item["suppressFailures"], + protectedSettingsFromKeyVault: !item["protectedSettingsFromKeyVault"] + ? item["protectedSettingsFromKeyVault"] + : keyVaultSecretReferenceDeserializer(item["protectedSettingsFromKeyVault"]), + provisionAfterExtensions: !item["provisionAfterExtensions"] + ? item["provisionAfterExtensions"] + : item["provisionAfterExtensions"].map((p: any) => { + return p; + }), + }; +} + +/** ZoneAllocationPolicy for LaunchBulkInstancesOperation. */ +export interface ZoneAllocationPolicy { + /** Distribution strategy used for zone allocation policy. */ + distributionStrategy: ZoneDistributionStrategy; + /** Zone preferences, required when zone distribution strategy is Prioritized. */ + zonePreferences?: ZonePreference[]; +} + +export function zoneAllocationPolicySerializer(item: ZoneAllocationPolicy): any { + return { + distributionStrategy: item["distributionStrategy"], + zonePreferences: !item["zonePreferences"] + ? item["zonePreferences"] + : zonePreferenceArraySerializer(item["zonePreferences"]), + }; +} + +export function zoneAllocationPolicyDeserializer(item: any): ZoneAllocationPolicy { + return { + distributionStrategy: item["distributionStrategy"], + zonePreferences: !item["zonePreferences"] + ? item["zonePreferences"] + : zonePreferenceArrayDeserializer(item["zonePreferences"]), + }; +} + +/** Distribution strategies for LaunchBulkInstancesOperation zone allocation policy. */ +export enum KnownZoneDistributionStrategy { + /** + * Default. Launch instances in a single zone based on best effort. + * If capacity is not available, LaunchBulkInstancesOperation can allocate capacity in different zones. + */ + BestEffortSingleZone = "BestEffortSingleZone", + /** + * Launch instances based on zone preferences. + * Higher priority zones are filled first before allocating to lower priority zones. + */ + Prioritized = "Prioritized", + /** + * Balance launching instances across zones specified based on best effort. + * If capacity is not available, LaunchBulkInstancesOperation can deviate balancing across all zones. + */ + BestEffortBalanced = "BestEffortBalanced", + /** Launch instances across all provided zones, ensuring the difference between any two zones is no more than one instance. */ + StrictBalanced = "StrictBalanced", +} + +/** + * Distribution strategies for LaunchBulkInstancesOperation zone allocation policy. \ + * {@link KnownZoneDistributionStrategy} can be used interchangeably with ZoneDistributionStrategy, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **BestEffortSingleZone**: Default. Launch instances in a single zone based on best effort. + * If capacity is not available, LaunchBulkInstancesOperation can allocate capacity in different zones. \ + * **Prioritized**: Launch instances based on zone preferences. + * Higher priority zones are filled first before allocating to lower priority zones. \ + * **BestEffortBalanced**: Balance launching instances across zones specified based on best effort. + * If capacity is not available, LaunchBulkInstancesOperation can deviate balancing across all zones. \ + * **StrictBalanced**: Launch instances across all provided zones, ensuring the difference between any two zones is no more than one instance. + */ +export type ZoneDistributionStrategy = string; + +export function zonePreferenceArraySerializer(result: Array): any[] { + return result.map((item) => { + return zonePreferenceSerializer(item); + }); +} + +export function zonePreferenceArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return zonePreferenceDeserializer(item); + }); +} + +/** Zone preferences for LaunchBulkInstancesOperation zone allocation policy. */ +export interface ZonePreference { + /** Name of the zone. */ + zone: string; + /** + * The rank of the zone. This is used with 'Prioritized' ZoneDistributionStrategy. + * The lower the number, the higher the priority, starting with 0. + * 0 is the highest rank. If not specified, defaults to lowest rank. + */ + rank?: number; +} + +export function zonePreferenceSerializer(item: ZonePreference): any { + return { zone: item["zone"], rank: item["rank"] }; +} + +export function zonePreferenceDeserializer(item: any): ZonePreference { + return { + zone: item["zone"], + rank: item["rank"], + }; +} + +/** The retry policy for the user request */ +export interface RetryPolicy { + /** Retry count for user request */ + retryCount?: number; + /** Retry window in minutes for user request */ + retryWindowInMinutes?: number; +} + +export function retryPolicySerializer(item: RetryPolicy): any { + return { retryCount: item["retryCount"], retryWindowInMinutes: item["retryWindowInMinutes"] }; +} + +export function retryPolicyDeserializer(item: any): RetryPolicy { + return { + retryCount: item["retryCount"], + retryWindowInMinutes: item["retryWindowInMinutes"], + }; +} + +/** 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"] + ? item["userAssignedIdentities"] + : Object.fromEntries( + Object.entries(item["userAssignedIdentities"]).map(([k, p]: [string, any]) => [ + k, + !p ? p : userAssignedIdentityDeserializer(p), + ]), + ), + }; +} + +/** 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"], + }; +} + +/** Plan for the resource. */ +export interface Plan { + /** A user defined name of the 3rd Party Artifact that is being procured. */ + name: string; + /** The publisher of the 3rd Party Artifact that is being bought. E.g. NewRelic */ + publisher: string; + /** The 3rd Party artifact that is being procured. E.g. NewRelic. Product maps to the OfferID specified for the artifact at the time of Data Market onboarding. */ + product: string; + /** A publisher provided promotion code as provisioned in Data Market for the said product/artifact. */ + promotionCode?: string; + /** The version of the desired product/artifact. */ + version?: string; +} + +export function planSerializer(item: Plan): any { + return { + name: item["name"], + publisher: item["publisher"], + product: item["product"], + promotionCode: item["promotionCode"], + version: item["version"], + }; +} + +export function planDeserializer(item: any): Plan { + return { + name: item["name"], + publisher: item["publisher"], + product: item["product"], + promotionCode: item["promotionCode"], + version: item["version"], + }; +} + +/** 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"]), + }; +} + +/** 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; + +/** The current status of an async operation. */ +export interface OperationStatusResult { + /** Fully qualified ID for the async operation. */ + id?: string; + /** Name of the async operation. */ + name?: string; + /** Operation status. */ + status: string; + /** Percent of the operation that is complete. */ + percentComplete?: number; + /** The start time of the operation. */ + startTime?: Date; + /** The end time of the operation. */ + endTime?: Date; + /** The operations list. */ + operations?: OperationStatusResult[]; + /** If present, details of the operation error. */ + error?: ErrorDetail; + /** Fully qualified ID of the resource against which the original async operation was started. */ + readonly resourceId?: string; +} + +export function operationStatusResultDeserializer(item: any): OperationStatusResult { + return { + id: item["id"], + name: item["name"], + status: item["status"], + percentComplete: item["percentComplete"], + startTime: !item["startTime"] ? item["startTime"] : new Date(item["startTime"]), + endTime: !item["endTime"] ? item["endTime"] : new Date(item["endTime"]), + operations: !item["operations"] + ? item["operations"] + : operationStatusResultArrayDeserializer(item["operations"]), + error: !item["error"] ? item["error"] : errorDetailDeserializer(item["error"]), + resourceId: item["resourceId"], + }; +} + +export function operationStatusResultArrayDeserializer( + result: Array, +): any[] { + return result.map((item) => { + return operationStatusResultDeserializer(item); + }); +} + +/** List of LaunchBulkInstancesOperation resources. */ +export interface _LaunchBulkInstancesOperationListResult { + /** The list of LaunchBulkInstancesOperation resources. */ + value: LocationBasedLaunchBulkInstancesOperation[]; + /** The URL to get the next set of results. */ + nextLink?: string; +} + +export function _launchBulkInstancesOperationListResultDeserializer( + item: any, +): _LaunchBulkInstancesOperationListResult { + return { + value: locationBasedLaunchBulkInstancesOperationArrayDeserializer(item["value"]), + nextLink: item["nextLink"], + }; +} + +export function locationBasedLaunchBulkInstancesOperationArraySerializer( + result: Array, +): any[] { + return result.map((item) => { + return locationBasedLaunchBulkInstancesOperationSerializer(item); + }); +} + +export function locationBasedLaunchBulkInstancesOperationArrayDeserializer( + result: Array, +): any[] { + return result.map((item) => { + return locationBasedLaunchBulkInstancesOperationDeserializer(item); + }); +} + +/** The response of a virtual machine list operation. */ +export interface _VirtualMachineListResult { + /** The Virtual Machine items on this page. */ + value: VirtualMachine[]; + /** The link to the next page of items. */ + nextLink?: string; +} + +export function _virtualMachineListResultDeserializer(item: any): _VirtualMachineListResult { + return { + value: virtualMachineArrayDeserializer(item["value"]), + nextLink: item["nextLink"], + }; +} + +export function virtualMachineArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return virtualMachineDeserializer(item); + }); +} + +/** An instant Fleet's virtual machine. */ +export interface VirtualMachine { + /** The name of the virtual machine. */ + readonly name: string; + /** The compute RP resource id of the virtual machine. subscriptions/{subId}/resourceGroups/{rgName}/providers/Microsoft.Compute/virtualMachines/{vmName} */ + readonly id: string; + /** Type of the virtual machine */ + readonly type?: string; + /** This represents the operationStatus of the virtual machine in response to the last operation that was performed on it by Azure Fleet resource. */ + readonly operationStatus: VMOperationStatus; + /** Error information when `operationStatus` is `Failed`. */ + readonly error?: ApiError; +} + +export function virtualMachineDeserializer(item: any): VirtualMachine { + return { + name: item["name"], + id: item["id"], + type: item["type"], + operationStatus: item["operationStatus"], + error: !item["error"] ? item["error"] : apiErrorDeserializer(item["error"]), + }; +} + +/** Virtual Machine operation status values. */ +export enum KnownVMOperationStatus { + /** Indicates that the virtual machine is either in the process of being created or is scheduled to be created. */ + Creating = "Creating", + /** Indicates that the cancellation request was successful because the virtual machine had not been created yet. */ + Canceled = "Canceled", + /** Indicates that the cancellation request could not be applied because the virtual machine had already been created. */ + CancelFailedStatusUnknown = "CancelFailedStatusUnknown", + /** Indicates that the virtual machine operation failed. */ + Failed = "Failed", + /** Indicates that the virtual machine operation completed successfully. */ + Succeeded = "Succeeded", + /** Indicates that the virtual machine is being deleted. */ + Deleting = "Deleting", + /** Indicates that the virtual machine operation is being cancelled. */ + Cancelling = "Cancelling", +} + +/** + * Virtual Machine operation status values. \ + * {@link KnownVMOperationStatus} can be used interchangeably with VMOperationStatus, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Creating**: Indicates that the virtual machine is either in the process of being created or is scheduled to be created. \ + * **Canceled**: Indicates that the cancellation request was successful because the virtual machine had not been created yet. \ + * **CancelFailedStatusUnknown**: Indicates that the cancellation request could not be applied because the virtual machine had already been created. \ + * **Failed**: Indicates that the virtual machine operation failed. \ + * **Succeeded**: Indicates that the virtual machine operation completed successfully. \ + * **Deleting**: Indicates that the virtual machine is being deleted. \ + * **Cancelling**: Indicates that the virtual machine operation is being cancelled. + */ +export type VMOperationStatus = string; + +/** ApiError for Fleet */ +export interface ApiError { + /** The error code. */ + code?: string; + /** The target of the particular error. */ + target?: string; + /** The error message. */ + message?: string; + /** The API error details */ + details?: ApiErrorBase[]; + /** The API inner error */ + innererror?: InnerError; +} + +export function apiErrorDeserializer(item: any): ApiError { + return { + code: item["code"], + target: item["target"], + message: item["message"], + details: !item["details"] ? item["details"] : apiErrorBaseArrayDeserializer(item["details"]), + innererror: !item["innererror"] + ? item["innererror"] + : innerErrorDeserializer(item["innererror"]), + }; +} + +export function apiErrorBaseArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return apiErrorBaseDeserializer(item); + }); +} + +/** API error base. */ +export interface ApiErrorBase { + /** The error code. */ + code?: string; + /** The target of the particular error. */ + target?: string; + /** The error message. */ + message?: string; +} + +export function apiErrorBaseDeserializer(item: any): ApiErrorBase { + return { + code: item["code"], + target: item["target"], + message: item["message"], + }; +} + +/** Inner error details. */ +export interface InnerError { + /** The exception type. */ + exceptionType?: string; + /** The internal error message or exception dump. */ + errorDetail?: string; +} + +export function innerErrorDeserializer(item: any): InnerError { + return { + exceptionType: item["exceptionType"], + errorDetail: item["errorDetail"], + }; +} + +/** The ExecuteDeallocateRequest request for executeDeallocate operations */ +export interface ExecuteDeallocateRequest { + /** The execution parameters for the request */ + executionParameters: ExecutionParameters; + /** The resources for the request */ + resources?: Resources; + /** CorrelationId item */ + correlationid: string; +} + +export function executeDeallocateRequestSerializer(item: ExecuteDeallocateRequest): any { + return { + executionParameters: executionParametersSerializer(item["executionParameters"]), + resources: !item["resources"] ? item["resources"] : resourcesSerializer(item["resources"]), + correlationid: item["correlationid"], + }; +} + +/** Extra details needed to run the user's request */ +export interface ExecutionParameters { + /** Details that could optimize the user's request */ + optimizationPreference?: OptimizationPreference; + /** Retry policy the user can pass */ + retryPolicy?: RetryPolicy; +} + +export function executionParametersSerializer(item: ExecutionParameters): any { + return { + optimizationPreference: item["optimizationPreference"], + retryPolicy: !item["retryPolicy"] + ? item["retryPolicy"] + : retryPolicySerializer(item["retryPolicy"]), + }; +} + +/** The preferences customers can select to optimize their requests to Bulkactions */ +export enum KnownOptimizationPreference { + /** Optimize while considering cost savings */ + Cost = "Cost", + /** Optimize while considering availability of resources */ + Availability = "Availability", + /** Optimize while considering a balance of cost and availability */ + CostAvailabilityBalanced = "CostAvailabilityBalanced", +} + +/** + * The preferences customers can select to optimize their requests to Bulkactions \ + * {@link KnownOptimizationPreference} can be used interchangeably with OptimizationPreference, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Cost**: Optimize while considering cost savings \ + * **Availability**: Optimize while considering availability of resources \ + * **CostAvailabilityBalanced**: Optimize while considering a balance of cost and availability + */ +export type OptimizationPreference = string; + +/** The resources needed for the user request */ +export interface Resources { + /** The resource ids used for the request */ + ids: string[]; +} + +export function resourcesSerializer(item: Resources): any { + return { + ids: item["ids"].map((p: any) => { + return p; + }), + }; +} + +/** The response from a deallocate request */ +export interface DeallocateResourceOperationResponse { + /** The description of the operation response */ + description: string; + /** The type of resources used in the request eg virtual machines */ + type: string; + /** The location of the request eg westus */ + location: string; + /** The results from the request. */ + results?: ResourceOperation[]; +} + +export function deallocateResourceOperationResponseDeserializer( + item: any, +): DeallocateResourceOperationResponse { + return { + description: item["description"], + type: item["type"], + location: item["location"], + results: !item["results"] + ? item["results"] + : resourceOperationArrayDeserializer(item["results"]), + }; +} + +export function resourceOperationArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return resourceOperationDeserializer(item); + }); +} + +/** Top level response from an operation on a resource */ +export interface ResourceOperation { + /** Unique identifier for the resource involved in the operation, eg Azure Resource Manager ID */ + resourceId?: string; + /** Resource level error code if it exists */ + errorCode?: string; + /** Resource level error details if they exist */ + errorDetails?: string; + /** Details of the operation performed on a resource */ + operation?: ResourceOperationDetails; +} + +export function resourceOperationDeserializer(item: any): ResourceOperation { + return { + resourceId: item["resourceId"], + errorCode: item["errorCode"], + errorDetails: item["errorDetails"], + operation: !item["operation"] + ? item["operation"] + : resourceOperationDetailsDeserializer(item["operation"]), + }; +} + +/** The details of a response from an operation on a resource */ +export interface ResourceOperationDetails { + /** Operation identifier for the unique operation */ + operationId: string; + /** Unique identifier for the resource involved in the operation, eg Azure Resource Manager ID */ + resourceId?: string; + /** Type of operation performed on the resources */ + opType?: ResourceOperationType; + /** Subscription id attached to the request */ + subscriptionId?: string; + /** Deadline for the operation */ + deadline?: string; + /** Type of deadline of the operation */ + deadlineType?: DeadlineType; + /** Current state of the operation */ + state?: OperationState; + /** Timezone for the operation */ + timezone?: string; + /** Operation level errors if they exist */ + resourceOperationError?: ResourceOperationError; + /** Time the operation was complete if errors are null */ + completedAt?: string; + /** Retry policy the user can pass */ + retryPolicy?: RetryPolicy; +} + +export function resourceOperationDetailsDeserializer(item: any): ResourceOperationDetails { + return { + operationId: item["operationId"], + resourceId: item["resourceId"], + opType: item["opType"], + subscriptionId: item["subscriptionId"], + deadline: item["deadline"], + deadlineType: item["deadlineType"], + state: item["state"], + timezone: item["timezone"], + resourceOperationError: !item["resourceOperationError"] + ? item["resourceOperationError"] + : resourceOperationErrorDeserializer(item["resourceOperationError"]), + completedAt: item["completedAt"], + retryPolicy: !item["retryPolicy"] + ? item["retryPolicy"] + : retryPolicyDeserializer(item["retryPolicy"]), + }; +} + +/** The kind of operation types that can be performed on resources eg Virtual Machines, using BulkActions */ +export enum KnownResourceOperationType { + /** The default value for this enum type */ + Unknown = "Unknown", + /** Start operations on the resources */ + Start = "Start", + /** Deallocate operations on the resources */ + Deallocate = "Deallocate", + /** Hibernate operations on the resources */ + Hibernate = "Hibernate", + /** Create operations on the resources */ + Create = "Create", + /** Delete operations on the resources */ + Delete = "Delete", +} + +/** + * The kind of operation types that can be performed on resources eg Virtual Machines, using BulkActions \ + * {@link KnownResourceOperationType} can be used interchangeably with ResourceOperationType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Unknown**: The default value for this enum type \ + * **Start**: Start operations on the resources \ + * **Deallocate**: Deallocate operations on the resources \ + * **Hibernate**: Hibernate operations on the resources \ + * **Create**: Create operations on the resources \ + * **Delete**: Delete operations on the resources + */ +export type ResourceOperationType = string; + +/** The types of deadlines supported by Bulkactions */ +export enum KnownDeadlineType { + /** Default value of Unknown. */ + Unknown = "Unknown", + /** Initiate the operation at the given deadline. */ + InitiateAt = "InitiateAt", + /** Complete the operation by the given deadline. */ + CompleteBy = "CompleteBy", +} + +/** + * The types of deadlines supported by Bulkactions \ + * {@link KnownDeadlineType} can be used interchangeably with DeadlineType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Unknown**: Default value of Unknown. \ + * **InitiateAt**: Initiate the operation at the given deadline. \ + * **CompleteBy**: Complete the operation by the given deadline. + */ +export type DeadlineType = string; + +/** Values that define the states of operations in BulkActions */ +export enum KnownOperationState { + /** The default value for the operation state enum */ + Unknown = "Unknown", + /** Operations that are pending scheduling */ + PendingScheduling = "PendingScheduling", + /** Operations that have been scheduled */ + Scheduled = "Scheduled", + /** Operations that are waiting to be executed */ + PendingExecution = "PendingExecution", + /** Operations that are in the process of being executed */ + Executing = "Executing", + /** Operations that succeeded */ + Succeeded = "Succeeded", + /** Operations that have failed */ + Failed = "Failed", + /** Operations that have been Cancelled by the user */ + Cancelled = "Cancelled", + /** Operations that are blocked */ + Blocked = "Blocked", +} + +/** + * Values that define the states of operations in BulkActions \ + * {@link KnownOperationState} can be used interchangeably with OperationState, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Unknown**: The default value for the operation state enum \ + * **PendingScheduling**: Operations that are pending scheduling \ + * **Scheduled**: Operations that have been scheduled \ + * **PendingExecution**: Operations that are waiting to be executed \ + * **Executing**: Operations that are in the process of being executed \ + * **Succeeded**: Operations that succeeded \ + * **Failed**: Operations that have failed \ + * **Cancelled**: Operations that have been Cancelled by the user \ + * **Blocked**: Operations that are blocked + */ +export type OperationState = string; + +/** These describe errors that occur at the resource level */ +export interface ResourceOperationError { + /** Code for the error eg 404, 500 */ + errorCode: string; + /** Detailed message about the error */ + errorDetails: string; +} + +export function resourceOperationErrorDeserializer(item: any): ResourceOperationError { + return { + errorCode: item["errorCode"], + errorDetails: item["errorDetails"], + }; +} + +/** The ExecuteHibernateRequest request for executeHibernate operations */ +export interface ExecuteHibernateRequest { + /** The execution parameters for the request */ + executionParameters: ExecutionParameters; + /** The resources for the request */ + resources?: Resources; + /** CorrelationId item */ + correlationid: string; +} + +export function executeHibernateRequestSerializer(item: ExecuteHibernateRequest): any { + return { + executionParameters: executionParametersSerializer(item["executionParameters"]), + resources: !item["resources"] ? item["resources"] : resourcesSerializer(item["resources"]), + correlationid: item["correlationid"], + }; +} + +/** The response from a Hibernate request */ +export interface HibernateResourceOperationResponse { + /** The description of the operation response */ + description: string; + /** The type of resources used in the request eg virtual machines */ + type: string; + /** The location of the request eg westus */ + location: string; + /** The results from the request. */ + results?: ResourceOperation[]; +} + +export function hibernateResourceOperationResponseDeserializer( + item: any, +): HibernateResourceOperationResponse { + return { + description: item["description"], + type: item["type"], + location: item["location"], + results: !item["results"] + ? item["results"] + : resourceOperationArrayDeserializer(item["results"]), + }; +} + +/** The ExecuteStartRequest request for executeStart operations */ +export interface ExecuteStartRequest { + /** The execution parameters for the request */ + executionParameters: ExecutionParameters; + /** The resources for the request */ + resources?: Resources; + /** CorrelationId item */ + correlationid: string; +} + +export function executeStartRequestSerializer(item: ExecuteStartRequest): any { + return { + executionParameters: executionParametersSerializer(item["executionParameters"]), + resources: !item["resources"] ? item["resources"] : resourcesSerializer(item["resources"]), + correlationid: item["correlationid"], + }; +} + +/** The response from a start request */ +export interface StartResourceOperationResponse { + /** The description of the operation response */ + description: string; + /** The type of resources used in the request eg virtual machines */ + type: string; + /** The location of the request eg westus */ + location: string; + /** The results from the request. */ + results?: ResourceOperation[]; +} + +export function startResourceOperationResponseDeserializer( + item: any, +): StartResourceOperationResponse { + return { + description: item["description"], + type: item["type"], + location: item["location"], + results: !item["results"] + ? item["results"] + : resourceOperationArrayDeserializer(item["results"]), + }; +} + +/** The ExecuteCreateRequest request for create operations */ +export interface ExecuteCreateRequest { + /** resource creation payload */ + resourceConfigParameters: ResourceProvisionPayload; + /** The execution parameters for the request */ + executionParameters: ExecutionParameters; + /** CorrelationId item */ + correlationid?: string; +} + +export function executeCreateRequestSerializer(item: ExecuteCreateRequest): any { + return { + resourceConfigParameters: resourceProvisionPayloadSerializer(item["resourceConfigParameters"]), + executionParameters: executionParametersSerializer(item["executionParameters"]), + correlationid: item["correlationid"], + }; +} + +/** Resource creation data model */ +export interface ResourceProvisionPayload { + /** JSON object that contains VM properties that are common across all VMs in this batch (if you want to create 100 VMs in this request, and they all have same vmSize, then include vmSize in baseProfile) */ + baseProfile?: Record; + /** JSON array, that contains VM properties that should to be overridden for each VM in the batch (if you want to create 100 VMs, they all need a distinct computerName property, you pass computerNames for each VM in batch in this array), service will merge baseProfile with VM specific overrides and create a merged VMProfile. */ + resourceOverrides?: Record[]; + /** Number of VMs to be created */ + resourceCount: number; + /** if resourceOverrides doesn't contain "name", service will create name based of prefix and ResourceCount e.g. resourceprefix-0,resourceprefix-1.. */ + resourcePrefix?: string; +} + +export function resourceProvisionPayloadSerializer(item: ResourceProvisionPayload): any { + return { + baseProfile: item["baseProfile"], + resourceOverrides: !item["resourceOverrides"] + ? item["resourceOverrides"] + : item["resourceOverrides"].map((p: any) => { + return p; + }), + resourceCount: item["resourceCount"], + resourcePrefix: item["resourcePrefix"], + }; +} + +/** The response from a create request */ +export interface CreateResourceOperationResponse { + /** The description of the operation response */ + description: string; + /** The type of resources used in the request eg virtual machines */ + type: string; + /** The location of the request eg westus */ + location: string; + /** The results from the request. */ + results?: ResourceOperation[]; +} + +export function createResourceOperationResponseDeserializer( + item: any, +): CreateResourceOperationResponse { + return { + description: item["description"], + type: item["type"], + location: item["location"], + results: !item["results"] + ? item["results"] + : resourceOperationArrayDeserializer(item["results"]), + }; +} + +/** The ExecuteDeleteRequest for delete VM operation */ +export interface ExecuteDeleteRequest { + /** The execution parameters for the request */ + executionParameters: ExecutionParameters; + /** The resources for the request */ + resources?: Resources; + /** CorrelationId item */ + correlationid: string; + /** Forced delete resource item */ + forceDeletion?: boolean; +} + +export function executeDeleteRequestSerializer(item: ExecuteDeleteRequest): any { + return { + executionParameters: executionParametersSerializer(item["executionParameters"]), + resources: !item["resources"] ? item["resources"] : resourcesSerializer(item["resources"]), + correlationid: item["correlationid"], + forceDeletion: item["forceDeletion"], + }; +} + +/** The response from a delete request */ +export interface DeleteResourceOperationResponse { + /** The description of the operation response */ + description: string; + /** The type of resources used in the request eg virtual machines */ + type: string; + /** The location of the request eg westus */ + location: string; + /** The results from the request. */ + results?: ResourceOperation[]; +} + +export function deleteResourceOperationResponseDeserializer( + item: any, +): DeleteResourceOperationResponse { + return { + description: item["description"], + type: item["type"], + location: item["location"], + results: !item["results"] + ? item["results"] + : resourceOperationArrayDeserializer(item["results"]), + }; +} + +/** This is the request to get operation status using operationids */ +export interface GetOperationStatusRequest { + /** The list of operation ids to get the status of */ + operationIds: string[]; + /** CorrelationId item */ + correlationid: string; +} + +export function getOperationStatusRequestSerializer(item: GetOperationStatusRequest): any { + return { + operationIds: item["operationIds"].map((p: any) => { + return p; + }), + correlationid: item["correlationid"], + }; +} + +/** This is the response from a get operations status request */ +export interface GetOperationStatusResponse { + /** An array of resource operations based on their operation ids */ + results: ResourceOperation[]; +} + +export function getOperationStatusResponseDeserializer(item: any): GetOperationStatusResponse { + return { + results: resourceOperationArrayDeserializer(item["results"]), + }; +} + +/** This is the request to cancel running operations in bulkactions using the operation ids */ +export interface CancelOperationsRequest { + /** The list of operation ids to cancel operations on */ + operationIds: string[]; + /** CorrelationId item */ + correlationid: string; +} + +export function cancelOperationsRequestSerializer(item: CancelOperationsRequest): any { + return { + operationIds: item["operationIds"].map((p: any) => { + return p; + }), + correlationid: item["correlationid"], + }; +} + +/** This is the response from a cancel operations request */ +export interface CancelOperationsResponse { + /** An array of resource operations that were successfully cancelled */ + results: ResourceOperation[]; +} + +export function cancelOperationsResponseDeserializer(item: any): CancelOperationsResponse { + return { + results: resourceOperationArrayDeserializer(item["results"]), + }; +} + +/** BulkActions API versions */ +export enum KnownVersions { + /** 2026-02-01-preview version */ + _20260201Preview = "2026-02-01-preview", +} diff --git a/sdk/computebulkactions/arm-computebulkactions/src/restorePollerHelpers.ts b/sdk/computebulkactions/arm-computebulkactions/src/restorePollerHelpers.ts new file mode 100644 index 000000000000..4378f663b0e2 --- /dev/null +++ b/sdk/computebulkactions/arm-computebulkactions/src/restorePollerHelpers.ts @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { ComputeBulkActionsClient } from "./computeBulkActionsClient.js"; +import { + _cancelDeserialize, + _$deleteDeserialize, + _createOrUpdateDeserialize, +} from "./api/bulkActions/operations.js"; +import { getLongRunningPoller } from "./static-helpers/pollingHelpers.js"; +import type { OperationOptions, PathUncheckedResponse } from "@azure-rest/core-client"; +import type { AbortSignalLike } from "@azure/abort-controller"; +import type { PollerLike, OperationState, ResourceLocationConfig } from "@azure/core-lro"; +import { deserializeState } 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: ComputeBulkActionsClient, + 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}.`, + ); + } + const apiVersion = getApiVersionFromUrl(initialRequestUrl); + return getLongRunningPoller( + (client as any)["_client"] ?? client, + deserializeHelper as (result: TResponse) => Promise, + expectedStatuses, + { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + resourceLocationConfig, + restoreFrom: serializedState, + initialRequestUrl, + apiVersion, + }, + ); +} + +interface DeserializationHelper { + deserializer: (result: PathUncheckedResponse) => Promise; + expectedStatuses: string[]; +} + +const deserializeMap: Record = { + "POST /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ComputeBulkActions/locations/{location}/launchBulkInstancesOperations/{name}/cancel": + { deserializer: _cancelDeserialize, expectedStatuses: ["202", "200", "201"] }, + "DELETE /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ComputeBulkActions/locations/{location}/launchBulkInstancesOperations/{name}": + { deserializer: _$deleteDeserialize, expectedStatuses: ["202", "204", "200"] }, + "PUT /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ComputeBulkActions/locations/{location}/launchBulkInstancesOperations/{name}": + { deserializer: _createOrUpdateDeserialize, 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); +} + +function getApiVersionFromUrl(urlStr: string): string | undefined { + const url = new URL(urlStr); + return url.searchParams.get("api-version") ?? undefined; +} diff --git a/sdk/computebulkactions/arm-computebulkactions/src/static-helpers/cloudSettingHelpers.ts b/sdk/computebulkactions/arm-computebulkactions/src/static-helpers/cloudSettingHelpers.ts new file mode 100644 index 000000000000..613112c6e397 --- /dev/null +++ b/sdk/computebulkactions/arm-computebulkactions/src/static-helpers/cloudSettingHelpers.ts @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +/** + * An enum to describe Azure Cloud environments. + * @enum {string} + */ +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}`; + +/** + * Gets the Azure Resource Manager endpoint URL for the specified cloud setting. + * @param cloudSetting - The Azure cloud environment setting. Use one of the AzureClouds enum values. + * @returns The ARM endpoint URL for the specified cloud, or undefined if cloudSetting is undefined. + * @throws {Error} Throws an error if an unknown cloud setting is provided. + */ +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/computebulkactions/arm-computebulkactions/src/static-helpers/pagingHelpers.ts b/sdk/computebulkactions/arm-computebulkactions/src/static-helpers/pagingHelpers.ts new file mode 100644 index 000000000000..9258ba95eda8 --- /dev/null +++ b/sdk/computebulkactions/arm-computebulkactions/src/static-helpers/pagingHelpers.ts @@ -0,0 +1,270 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { Client, PathUncheckedResponse } from "@azure-rest/core-client"; +import { createRestError } 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; + nextLinkMethod?: "GET" | "POST"; + apiVersion?: 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 nextLinkMethod = options.nextLinkMethod ?? "GET"; + const apiVersion = options.apiVersion; + const pagedResult: PagedResult = { + getPage: async (pageLink?: string) => { + let result; + if (pageLink === undefined) { + result = await getInitialResponse(); + } else { + const resolvedPageLink = apiVersion ? addApiVersionToUrl(pageLink, apiVersion) : pageLink; + result = + nextLinkMethod === "POST" + ? await client.pathUnchecked(resolvedPageLink).post() + : await client.pathUnchecked(resolvedPageLink).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, + ); + } +} + +/** + * Adds the api-version query parameter on a URL if it's not present. + * @param url - the URL to modify + * @param apiVersion - the API version to set + * @returns - the URL with the api-version query parameter set + */ +function addApiVersionToUrl(url: string, apiVersion: string): string { + // The base URL is only used for parsing and won't appear in the returned URL + const urlObj = new URL(url, "https://microsoft.com"); + if (!urlObj.searchParams.get("api-version")) { + // Append one if there is no apiVersion + return `${url}${ + Array.from(urlObj.searchParams.keys()).length > 0 ? "&" : "?" + }api-version=${apiVersion}`; + } + return url; +} diff --git a/sdk/computebulkactions/arm-computebulkactions/src/static-helpers/pollingHelpers.ts b/sdk/computebulkactions/arm-computebulkactions/src/static-helpers/pollingHelpers.ts new file mode 100644 index 000000000000..8e36a866edcc --- /dev/null +++ b/sdk/computebulkactions/arm-computebulkactions/src/static-helpers/pollingHelpers.ts @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { + PollerLike, + OperationState, + ResourceLocationConfig, + RunningOperation, + OperationResponse, +} from "@azure/core-lro"; +import { createHttpPoller } from "@azure/core-lro"; + +import type { Client, PathUncheckedResponse } from "@azure-rest/core-client"; +import { createRestError } from "@azure-rest/core-client"; +import type { 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; + /** + * The api-version of the LRO + */ + apiVersion?: string; +} +export function getLongRunningPoller( + client: Client, + processResponseBody: (result: TResponse) => Promise, + expectedStatuses: string[], + options: GetLongRunningPollerOptions, +): PollerLike, TResult> { + const { restoreFrom, getInitialResponse, apiVersion } = 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 { + const pollingPath = apiVersion ? addApiVersionToUrl(path, apiVersion) : path; + response = await client.pathUnchecked(pollingPath).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, + }, + }; +} + +/** + * Adds the api-version query parameter on a URL if it's not present. + * @param url - the URL to modify + * @param apiVersion - the API version to set + * @returns - the URL with the api-version query parameter set + */ +function addApiVersionToUrl(url: string, apiVersion: string): string { + // The base URL is only used for parsing and won't appear in the returned URL + const urlObj = new URL(url, "https://microsoft.com"); + if (!urlObj.searchParams.get("api-version")) { + // Append one if there is no apiVersion + return `${url}${ + Array.from(urlObj.searchParams.keys()).length > 0 ? "&" : "?" + }api-version=${apiVersion}`; + } + return url; +} diff --git a/sdk/computebulkactions/arm-computebulkactions/src/static-helpers/urlTemplate.ts b/sdk/computebulkactions/arm-computebulkactions/src/static-helpers/urlTemplate.ts new file mode 100644 index 000000000000..e8af8cd3ab73 --- /dev/null +++ b/sdk/computebulkactions/arm-computebulkactions/src/static-helpers/urlTemplate.ts @@ -0,0 +1,227 @@ +// 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): string { + return (reserved ?? op === "+") || op === "#" + ? encodeReservedComponent(val) + : encodeRFC3986URIComponent(val); +} + +function encodeReservedComponent(str: string): 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): string { + return encodeURIComponent(str).replace( + /[!'()*]/g, + (c) => `%${c.charCodeAt(0).toString(16).toUpperCase()}`, + ); +} + +function isDefined(val: any): boolean { + return val !== undefined && val !== null; +} + +function getNamedAndIfEmpty(op?: string): [boolean, string] { + return [!!op && [";", "?", "&"].includes(op), !!op && ["?", "&"].includes(op) ? "=" : ""]; +} + +function getFirstOrSep(op?: string, isFirst = false): string { + if (isFirst) { + return !op || op === "+" ? "" : op; + } else if (!op || op === "+" || op === "#") { + return ","; + } else if (op === "?") { + return "&"; + } else { + return op; + } +} + +function getExpandedValue(option: ValueOptions): string { + 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)}`); + if (val === "") { + vals.push(ifEmpty); + } else { + 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)}`); + if (named && val === "") { + vals.push(ifEmpty); + } else { + vals.push("="); + } + } + vals.push(encodeComponent(val, reserved, op)); + isFirst = false; + } + } + return vals.join(""); +} + +function getNonExpandedValue(option: ValueOptions): string | undefined { + 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); + if (val === "") { + vals.push(ifEmpty); + } else { + 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 { + const result = 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 innerResult = []; + for (const varSpec of varList) { + const varMatch = /([^:*]*)(?::(\d+)|(\*))?/.exec(varSpec); + if (!varMatch || !varMatch[1]) { + continue; + } + const varValue = getVarValue({ + isFirst: innerResult.length === 0, + op, + varValue: context[varMatch[1]], + varName: varMatch[1], + modifier: varMatch[2] || varMatch[3], + reserved: option?.allowReserved, + }); + if (varValue) { + innerResult.push(varValue); + } + } + return innerResult.join(""); + }); + + return normalizeUnreserved(result); +} + +/** + * Normalize an expanded URI by decoding percent-encoded unreserved characters. + * RFC 3986 unreserved: "-" / "." / "~" + */ +function normalizeUnreserved(uri: string): string { + return uri.replace(/%([0-9A-Fa-f]{2})/g, (match, hex) => { + const char = String.fromCharCode(parseInt(hex, 16)); + // Decode only if it's unreserved + if (/[.~-]/.test(char)) { + return char; + } + return match; // leave other encodings intact + }); +} diff --git a/sdk/computebulkactions/arm-computebulkactions/test/public/sampleTest.spec.ts b/sdk/computebulkactions/arm-computebulkactions/test/public/sampleTest.spec.ts new file mode 100644 index 000000000000..19cf10ee4956 --- /dev/null +++ b/sdk/computebulkactions/arm-computebulkactions/test/public/sampleTest.spec.ts @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +// import { Recorder } from "@azure-tools/test-recorder"; +// import { createRecorder } from "./utils/recordedClient.js"; +import { + assert, + // beforeEach, + // afterEach, + it, + describe, +} from "vitest"; + +describe("My test", () => { + // let recorder: Recorder; + + // beforeEach(async function(ctx) { + // recorder = await createRecorder(ctx); + // }); + + // afterEach(async function() { + // await recorder.stop(); + // ); + + it("sample test", async function () { + assert.equal(1, 1); + }); +}); diff --git a/sdk/computebulkactions/arm-computebulkactions/test/public/utils/recordedClient.ts b/sdk/computebulkactions/arm-computebulkactions/test/public/utils/recordedClient.ts new file mode 100644 index 000000000000..285e4643c45e --- /dev/null +++ b/sdk/computebulkactions/arm-computebulkactions/test/public/utils/recordedClient.ts @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { RecorderStartOptions, VitestTestContext } from "@azure-tools/test-recorder"; +import { Recorder } 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/computebulkactions/arm-computebulkactions/test/snippets.spec.ts b/sdk/computebulkactions/arm-computebulkactions/test/snippets.spec.ts new file mode 100644 index 000000000000..927bd66c5b63 --- /dev/null +++ b/sdk/computebulkactions/arm-computebulkactions/test/snippets.spec.ts @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeBulkActionsClient } 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 ComputeBulkActionsClient(new DefaultAzureCredential(), subscriptionId); + }); + + it("ReadmeSampleCreateClient_Browser", async () => { + const credential = new InteractiveBrowserCredential({ + tenantId: "", + clientId: "", + }); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new ComputeBulkActionsClient(credential, subscriptionId); + }); + + it("SetLogLevel", async () => { + setLogLevel("info"); + }); +}); diff --git a/sdk/computebulkactions/arm-computebulkactions/tsconfig.browser.config.json b/sdk/computebulkactions/arm-computebulkactions/tsconfig.browser.config.json new file mode 100644 index 000000000000..5c581f5060f0 --- /dev/null +++ b/sdk/computebulkactions/arm-computebulkactions/tsconfig.browser.config.json @@ -0,0 +1,10 @@ +{ + "extends": "../../../tsconfig.browser.base.json", + "compilerOptions": { + "paths": { + "@azure/arm-computebulkactions": ["./dist/browser/index.d.ts"], + "@azure/arm-computebulkactions/*": ["./dist/browser/*"], + "$internal/*": ["./dist/browser/*"] + } + } +} diff --git a/sdk/computebulkactions/arm-computebulkactions/tsconfig.json b/sdk/computebulkactions/arm-computebulkactions/tsconfig.json new file mode 100644 index 000000000000..76a906bf45bf --- /dev/null +++ b/sdk/computebulkactions/arm-computebulkactions/tsconfig.json @@ -0,0 +1,13 @@ +{ + "references": [ + { + "path": "./tsconfig.src.json" + }, + { + "path": "./tsconfig.test.json" + }, + { + "path": "./tsconfig.snippets.json" + } + ] +} diff --git a/sdk/computebulkactions/arm-computebulkactions/tsconfig.snippets.json b/sdk/computebulkactions/arm-computebulkactions/tsconfig.snippets.json new file mode 100644 index 000000000000..6f3148b5ed97 --- /dev/null +++ b/sdk/computebulkactions/arm-computebulkactions/tsconfig.snippets.json @@ -0,0 +1,3 @@ +{ + "extends": ["../../../tsconfig.snippets.base.json"] +} diff --git a/sdk/computebulkactions/arm-computebulkactions/tsconfig.src.json b/sdk/computebulkactions/arm-computebulkactions/tsconfig.src.json new file mode 100644 index 000000000000..bae70752dd38 --- /dev/null +++ b/sdk/computebulkactions/arm-computebulkactions/tsconfig.src.json @@ -0,0 +1,3 @@ +{ + "extends": "../../../tsconfig.lib.json" +} diff --git a/sdk/computebulkactions/arm-computebulkactions/tsconfig.test.json b/sdk/computebulkactions/arm-computebulkactions/tsconfig.test.json new file mode 100644 index 000000000000..42798ad68913 --- /dev/null +++ b/sdk/computebulkactions/arm-computebulkactions/tsconfig.test.json @@ -0,0 +1,14 @@ +{ + "references": [ + { + "path": "./tsconfig.test.node.json" + }, + { + "path": "./tsconfig.browser.config.json" + } + ], + "compilerOptions": { + "composite": true + }, + "files": [] +} diff --git a/sdk/computebulkactions/arm-computebulkactions/tsconfig.test.node.json b/sdk/computebulkactions/arm-computebulkactions/tsconfig.test.node.json new file mode 100644 index 000000000000..522965c3bfb2 --- /dev/null +++ b/sdk/computebulkactions/arm-computebulkactions/tsconfig.test.node.json @@ -0,0 +1,10 @@ +{ + "extends": "../../../tsconfig.test.node.base.json", + "compilerOptions": { + "paths": { + "@azure/arm-computebulkactions": ["./src/index.ts"], + "@azure/arm-computebulkactions/*": ["./src/*"], + "$internal/*": ["./src/*"] + } + } +} diff --git a/sdk/computebulkactions/arm-computebulkactions/tsp-location.yaml b/sdk/computebulkactions/arm-computebulkactions/tsp-location.yaml new file mode 100644 index 000000000000..e02acfca0538 --- /dev/null +++ b/sdk/computebulkactions/arm-computebulkactions/tsp-location.yaml @@ -0,0 +1,4 @@ +directory: specification/computebulkactions/ComputeBulkActions.Management +commit: a6302ef6140d48c95c3126061b4a2edd9db9f67e +repo: Azure/azure-rest-api-specs +additionalDirectories: diff --git a/sdk/computebulkactions/arm-computebulkactions/vitest.browser.config.ts b/sdk/computebulkactions/arm-computebulkactions/vitest.browser.config.ts new file mode 100644 index 000000000000..72964f281efe --- /dev/null +++ b/sdk/computebulkactions/arm-computebulkactions/vitest.browser.config.ts @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import viteConfig from "../../../vitest.browser.shared.config.ts"; + +export default viteConfig; diff --git a/sdk/computebulkactions/arm-computebulkactions/vitest.config.ts b/sdk/computebulkactions/arm-computebulkactions/vitest.config.ts new file mode 100644 index 000000000000..0dfa15cc4498 --- /dev/null +++ b/sdk/computebulkactions/arm-computebulkactions/vitest.config.ts @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import viteConfig from "../../../vitest.shared.config.ts"; + +export default viteConfig; diff --git a/sdk/computebulkactions/arm-computebulkactions/vitest.esm.config.ts b/sdk/computebulkactions/arm-computebulkactions/vitest.esm.config.ts new file mode 100644 index 000000000000..5e9735e9b144 --- /dev/null +++ b/sdk/computebulkactions/arm-computebulkactions/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/computebulkactions/ci.mgmt.yml b/sdk/computebulkactions/ci.mgmt.yml new file mode 100644 index 000000000000..a77244142c1f --- /dev/null +++ b/sdk/computebulkactions/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/computebulkactions/arm-computebulkactions + - sdk/computebulkactions/ci.mgmt.yml +pr: + branches: + include: + - main + - feature/* + - release/* + - hotfix/* + exclude: + - feature/v4 + paths: + include: + - sdk/computebulkactions/arm-computebulkactions + - sdk/computebulkactions/ci.mgmt.yml +extends: + template: /eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: computebulkactions + Artifacts: + - name: azure-arm-computebulkactions + safeName: azurearmcomputebulkactions